Skip to content

Commit

Permalink
[IMP] account_global_discount: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-S73 authored and ferran-S73 committed Sep 27, 2024
1 parent 33e9546 commit c7661b9
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 105 deletions.
88 changes: 46 additions & 42 deletions account_global_discount/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Account Global Discount
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/16.0/account_global_discount
:target: https://github.com/OCA/account-invoicing/tree/17.0/account_global_discount
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_global_discount
:target: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_global_discount
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -40,80 +40,84 @@ Configuration

To configure this module, you need to:

#. Go to *Settings > Parameters > Global Discounts*.
#. Add a new discount percentage.
#. Choose the discount scope (sales or purchases).
#. You can also restrict it to a certain company if needed.
1. Go to *Settings > Parameters > Global Discounts*.
2. Add a new discount percentage.
3. Choose the discount scope (sales or purchases).
4. You can also restrict it to a certain company if needed.

You can assign global discounts to partners as well:

#. Go to a partner that is a company.
#. Go to the *Sales & Purchases* tab.
#. In section sale, you can set sale discounts.
#. In section purchase, you can set purchase discounts.
1. Go to a partner that is a company.
2. Go to the *Sales & Purchases* tab.
3. In section sale, you can set sale discounts.
4. In section purchase, you can set purchase discounts.

Usage
=====

To use this module, you need to:

#. Go to *Invoicing > Customers > Invoices*.
#. Create a new sales invoice, choose a customer with a defined global
discount and you will see how the value of the 'Invoice Global Discounts'
field is auto-completed with the global discounts defined in the customer
(See configuration section in this readme), although you can choose
then other global discounts defined in configuration.
#. Add several invoice lines.
#. At the bottom of the form you will see how global discounts affect the
total values.
#. Go to the 'Journal Items' tab (if you have permissions for that).
There you will see how the tax lines have the discount percentage applied
and you will also see the lines that reflect the global discount applied.
#. In the 'Other info' tab, you can see in the 'Global Discounts' table,
1. Go to *Invoicing > Customers > Invoices*.
2. Create a new sales invoice, choose a customer with a defined global
discount and you will see how the value of the 'Invoice Global
Discounts' field is auto-completed with the global discounts defined
in the customer (See configuration section in this readme), although
you can choose then other global discounts defined in configuration.
3. Add several invoice lines.
4. At the bottom of the form you will see how global discounts affect
the total values.
5. Go to the 'Journal Items' tab (if you have permissions for that).
There you will see how the tax lines have the discount percentage
applied and you will also see the lines that reflect the global
discount applied.
6. In the 'Other info' tab, you can see in the 'Global Discounts' table,
the global discounts applied to each of the invoice lines.

Known issues / Roadmap
======================

* Not all the taxes combination can be compatible with global discounts, as
the generated journal items won't be correct for taxes declarations. An error
is raised in that cases.
* Currently, taxes in invoice lines are mandatory with global discounts.
* No tax tags are populated for the global discount move lines, only `tax_ids`.
- Not all the taxes combination can be compatible with global
discounts, as the generated journal items won't be correct for taxes
declarations. An error is raised in that cases.
- Currently, taxes in invoice lines are mandatory with global
discounts.
- No tax tags are populated for the global discount move lines, only
tax_ids.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_global_discount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_global_discount%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~
-------

* Tecnativa

Contributors
~~~~~~~~~~~~
------------

* `Tecnativa <https://www.tecnativa.com>`_
- `Tecnativa <https://www.tecnativa.com>`__

* Pedro M. Baeza
* David Vidal
* Carlos Dauden
* Rafael Blasco
* Ernesto Tejeda
* Víctor Martínez
* Omar Castiñeira <[email protected]>
- Pedro M. Baeza
- David Vidal
- Carlos Dauden
- Rafael Blasco
- Ernesto Tejeda
- Víctor Martínez

- Omar Castiñeira <[email protected]>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -125,6 +129,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/account_global_discount>`_ project on GitHub.
This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/17.0/account_global_discount>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_global_discount/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
13 changes: 13 additions & 0 deletions account_global_discount/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To configure this module, you need to:

1. Go to *Settings \> Parameters \> Global Discounts*.
2. Add a new discount percentage.
3. Choose the discount scope (sales or purchases).
4. You can also restrict it to a certain company if needed.

You can assign global discounts to partners as well:

1. Go to a partner that is a company.
2. Go to the *Sales & Purchases* tab.
3. In section sale, you can set sale discounts.
4. In section purchase, you can set purchase discounts.
13 changes: 0 additions & 13 deletions account_global_discount/readme/CONFIGURE.rst

This file was deleted.

8 changes: 8 additions & 0 deletions account_global_discount/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [Tecnativa](https://www.tecnativa.com)
- Pedro M. Baeza
- David Vidal
- Carlos Dauden
- Rafael Blasco
- Ernesto Tejeda
- Víctor Martínez
- Omar Castiñeira \<<[email protected]>\>
9 changes: 0 additions & 9 deletions account_global_discount/readme/CONTRIBUTORS.rst

This file was deleted.

6 changes: 6 additions & 0 deletions account_global_discount/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Not all the taxes combination can be compatible with global discounts,
as the generated journal items won't be correct for taxes
declarations. An error is raised in that cases.
- Currently, taxes in invoice lines are mandatory with global discounts.
- No tax tags are populated for the global discount move lines, only
tax_ids.
5 changes: 0 additions & 5 deletions account_global_discount/readme/ROADMAP.rst

This file was deleted.

17 changes: 17 additions & 0 deletions account_global_discount/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To use this module, you need to:

1. Go to *Invoicing \> Customers \> Invoices*.
2. Create a new sales invoice, choose a customer with a defined global
discount and you will see how the value of the 'Invoice Global
Discounts' field is auto-completed with the global discounts defined
in the customer (See configuration section in this readme), although
you can choose then other global discounts defined in configuration.
3. Add several invoice lines.
4. At the bottom of the form you will see how global discounts affect
the total values.
5. Go to the 'Journal Items' tab (if you have permissions for that).
There you will see how the tax lines have the discount percentage
applied and you will also see the lines that reflect the global
discount applied.
6. In the 'Other info' tab, you can see in the 'Global Discounts'
table, the global discounts applied to each of the invoice lines.
16 changes: 0 additions & 16 deletions account_global_discount/readme/USAGE.rst

This file was deleted.

46 changes: 26 additions & 20 deletions account_global_discount/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,7 +369,7 @@ <h1 class="title">Account Global Discount</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2ca255fdd44114cd7497a3f2adf9e073832d649ae20b802c09d6ac7dc415050e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-invoicing/tree/16.0/account_global_discount"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_global_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-invoicing/tree/17.0/account_global_discount"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_global_discount"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Apply global discounts to invoices</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -408,36 +409,39 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<ol class="arabic simple">
<li>Go to <em>Invoicing &gt; Customers &gt; Invoices</em>.</li>
<li>Create a new sales invoice, choose a customer with a defined global
discount and you will see how the value of the ‘Invoice Global Discounts’
field is auto-completed with the global discounts defined in the customer
(See configuration section in this readme), although you can choose
then other global discounts defined in configuration.</li>
discount and you will see how the value of the ‘Invoice Global
Discounts’ field is auto-completed with the global discounts defined
in the customer (See configuration section in this readme), although
you can choose then other global discounts defined in configuration.</li>
<li>Add several invoice lines.</li>
<li>At the bottom of the form you will see how global discounts affect the
total values.</li>
<li>At the bottom of the form you will see how global discounts affect
the total values.</li>
<li>Go to the ‘Journal Items’ tab (if you have permissions for that).
There you will see how the tax lines have the discount percentage applied
and you will also see the lines that reflect the global discount applied.</li>
There you will see how the tax lines have the discount percentage
applied and you will also see the lines that reflect the global
discount applied.</li>
<li>In the ‘Other info’ tab, you can see in the ‘Global Discounts’ table,
the global discounts applied to each of the invoice lines.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Not all the taxes combination can be compatible with global discounts, as
the generated journal items won’t be correct for taxes declarations. An error
is raised in that cases.</li>
<li>Currently, taxes in invoice lines are mandatory with global discounts.</li>
<li>No tax tags are populated for the global discount move lines, only <cite>tax_ids</cite>.</li>
<li>Not all the taxes combination can be compatible with global
discounts, as the generated journal items won’t be correct for taxes
declarations. An error is raised in that cases.</li>
<li>Currently, taxes in invoice lines are mandatory with global
discounts.</li>
<li>No tax tags are populated for the global discount move lines, only
tax_ids.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_global_discount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_global_discount%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -466,11 +470,13 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/16.0/account_global_discount">OCA/account-invoicing</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/17.0/account_global_discount">OCA/account-invoicing</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down

0 comments on commit c7661b9

Please sign in to comment.