[IMP] contract_variable_quantity: pre-commit auto fixes

This commit is contained in:
Juanjo
2024-07-22 12:00:30 +02:00
parent 3efbeb5fdd
commit 9af4922f35
10 changed files with 93 additions and 77 deletions

View File

@@ -17,13 +17,13 @@ Variable quantity in contract recurrent invoicing
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/16.0/contract_variable_quantity :target: https://github.com/OCA/contract/tree/17.0/contract_variable_quantity
:alt: OCA/contract :alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_variable_quantity :target: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract_variable_quantity
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=16.0 :target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=17.0
:alt: Try me on Runboat :alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -39,33 +39,37 @@ lines with variable quantity according to a provided formula.
Configuration Configuration
============= =============
#. Go to Invoicing > Configuration > Contracts > Formulas (quantity). 1. Go to Invoicing > Configuration > Contracts > Formulas (quantity).
#. Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable 'result'. 2. Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable
'result'.
You can use these variables to compute your formula: You can use these variables to compute your formula:
* *env*: Environment variable for getting other models. - *env*: Environment variable for getting other models.
* *context*: Current context dictionary. - *context*: Current context dictionary.
* *user*: Current user. - *user*: Current user.
* *line*: Contract recurring invoice line that triggers this formula. - *line*: Contract recurring invoice line that triggers this
* *contract*: Contract whose line belongs to. formula.
* *invoice*: Invoice (header) being created. - *contract*: Contract whose line belongs to.
- *invoice*: Invoice (header) being created.
.. figure:: https://raw.githubusercontent.com/OCA/contract/16.0/contract_variable_quantity/images/formula_form.png |image1|
:alt: Formula form
:width: 600 px .. |image1| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract_variable_quantity/images/formula_form.png
Usage Usage
===== =====
To use this module, you need to: To use this module, you need to:
#. Go to Invoicing > Sales > Contracts and select or create a new contract. 1. Go to Invoicing > Sales > Contracts and select or create a new
#. Check *Generate recurring invoices automatically*. contract.
#. Add a new recurring invoicing line. 2. Check *Generate recurring invoices automatically*.
#. Select "Variable quantity" in column "Qty. type". 3. Add a new recurring invoicing line.
#. Select one of the possible formulas to use (previously created). 4. Select "Variable quantity" in column "Qty. type".
5. Select one of the possible formulas to use (previously created).
Bug Tracker Bug Tracker
=========== ===========
@@ -73,7 +77,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_variable_quantity%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_variable_quantity%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. Do not contact contributors directly about support or help with technical issues.
@@ -81,25 +85,26 @@ Credits
======= =======
Authors Authors
~~~~~~~ -------
* Tecnativa * Tecnativa
Contributors Contributors
~~~~~~~~~~~~ ------------
* `Tecnativa <https://www.tecnativa.com>`_: - `Tecnativa <https://www.tecnativa.com>`__:
* Pedro M. Baeza - Pedro M. Baeza
* Carlos Roca - Carlos Roca
* Víctor Martínez - Víctor Martínez
* Carolina Fernandez - Carolina Fernandez
* Dave Lasley <dave@laslabs.com> - Dave Lasley <dave@laslabs.com>
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
- Souheil Bejaoui <souheil.bejaoui@acsone.eu>
Maintainers Maintainers
~~~~~~~~~~~ -----------
This module is maintained by the OCA. This module is maintained by the OCA.
@@ -111,6 +116,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/16.0/contract_variable_quantity>`_ project on GitHub. This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/17.0/contract_variable_quantity>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -0,0 +1,18 @@
1. Go to Invoicing \> Configuration \> Contracts \> Formulas
(quantity).
2. Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable
'result'.
You can use these variables to compute your formula:
- *env*: Environment variable for getting other models.
- *context*: Current context dictionary.
- *user*: Current user.
- *line*: Contract recurring invoice line that triggers this
formula.
- *contract*: Contract whose line belongs to.
- *invoice*: Invoice (header) being created.
![](images/formula_form.png)

View File

@@ -1,16 +0,0 @@
#. Go to Invoicing > Configuration > Contracts > Formulas (quantity).
#. Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable 'result'.
You can use these variables to compute your formula:
* *env*: Environment variable for getting other models.
* *context*: Current context dictionary.
* *user*: Current user.
* *line*: Contract recurring invoice line that triggers this formula.
* *contract*: Contract whose line belongs to.
* *invoice*: Invoice (header) being created.
.. figure:: images/formula_form.png
:alt: Formula form
:width: 600 px

View File

@@ -0,0 +1,10 @@
- [Tecnativa](https://www.tecnativa.com):
> - Pedro M. Baeza
> - Carlos Roca
> - Víctor Martínez
> - Carolina Fernandez
- Dave Lasley \<<dave@laslabs.com>\>
- Souheil Bejaoui \<<souheil.bejaoui@acsone.eu>\>

View File

@@ -1,9 +0,0 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Pedro M. Baeza
* Carlos Roca
* Víctor Martínez
* Carolina Fernandez
* Dave Lasley <dave@laslabs.com>
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>

View File

@@ -0,0 +1,8 @@
To use this module, you need to:
1. Go to Invoicing \> Sales \> Contracts and select or create a new
contract.
2. Check *Generate recurring invoices automatically*.
3. Add a new recurring invoicing line.
4. Select "Variable quantity" in column "Qty. type".
5. Select one of the possible formulas to use (previously created).

View File

@@ -1,7 +0,0 @@
To use this module, you need to:
#. Go to Invoicing > Sales > Contracts and select or create a new contract.
#. Check *Generate recurring invoices automatically*.
#. Add a new recurring invoicing line.
#. Select "Variable quantity" in column "Qty. type".
#. Select one of the possible formulas to use (previously created).

View File

@@ -8,10 +8,11 @@
/* /*
:Author: David Goodger (goodger@python.org) :Author: David Goodger (goodger@python.org)
: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. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
@@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 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, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic { span.problematic, pre.problematic {
color: red } color: red }
span.section-subtitle { span.section-subtitle {
@@ -368,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7dad3fabe1f8a0ae7a25a3320507edb1f3c5c88cd5f4000a85ed524ffc321cfb !! source digest: sha256:7dad3fabe1f8a0ae7a25a3320507edb1f3c5c88cd5f4000a85ed524ffc321cfb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/contract/tree/16.0/contract_variable_quantity"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_variable_quantity"><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/contract&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/contract/tree/17.0/contract_variable_quantity"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract_variable_quantity"><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/contract&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>With this module, you will be able to define in recurring contracts some <p>With this module, you will be able to define in recurring contracts some
lines with variable quantity according to a provided formula.</p> lines with variable quantity according to a provided formula.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
@@ -391,27 +392,28 @@ lines with variable quantity according to a provided formula.</p>
<li><p class="first">Go to Invoicing &gt; Configuration &gt; Contracts &gt; Formulas (quantity).</p> <li><p class="first">Go to Invoicing &gt; Configuration &gt; Contracts &gt; Formulas (quantity).</p>
</li> </li>
<li><p class="first">Define any formula based on Python code that stores at some moment a <li><p class="first">Define any formula based on Python code that stores at some moment a
float/integer value of the quantity to invoice in the variable result.</p> float/integer value of the quantity to invoice in the variable
result.</p>
<p>You can use these variables to compute your formula:</p> <p>You can use these variables to compute your formula:</p>
<ul class="simple"> <ul class="simple">
<li><em>env</em>: Environment variable for getting other models.</li> <li><em>env</em>: Environment variable for getting other models.</li>
<li><em>context</em>: Current context dictionary.</li> <li><em>context</em>: Current context dictionary.</li>
<li><em>user</em>: Current user.</li> <li><em>user</em>: Current user.</li>
<li><em>line</em>: Contract recurring invoice line that triggers this formula.</li> <li><em>line</em>: Contract recurring invoice line that triggers this
formula.</li>
<li><em>contract</em>: Contract whose line belongs to.</li> <li><em>contract</em>: Contract whose line belongs to.</li>
<li><em>invoice</em>: Invoice (header) being created.</li> <li><em>invoice</em>: Invoice (header) being created.</li>
</ul> </ul>
</li> </li>
</ol> </ol>
<div class="figure"> <p><img alt="image1" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract_variable_quantity/images/formula_form.png" /></p>
<img alt="Formula form" src="https://raw.githubusercontent.com/OCA/contract/16.0/contract_variable_quantity/images/formula_form.png" style="width: 600px;" />
</div>
</div> </div>
<div class="section" id="usage"> <div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1> <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>To use this module, you need to:</p> <p>To use this module, you need to:</p>
<ol class="arabic simple"> <ol class="arabic simple">
<li>Go to Invoicing &gt; Sales &gt; Contracts and select or create a new contract.</li> <li>Go to Invoicing &gt; Sales &gt; Contracts and select or create a new
contract.</li>
<li>Check <em>Generate recurring invoices automatically</em>.</li> <li>Check <em>Generate recurring invoices automatically</em>.</li>
<li>Add a new recurring invoicing line.</li> <li>Add a new recurring invoicing line.</li>
<li>Select “Variable quantity” in column “Qty. type”.</li> <li>Select “Variable quantity” in column “Qty. type”.</li>
@@ -423,7 +425,7 @@ float/integer value of the quantity to invoice in the variable result.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 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/contract/issues/new?body=module:%20contract_variable_quantity%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/contract/issues/new?body=module:%20contract_variable_quantity%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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -456,11 +458,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2> <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/16.0/contract_variable_quantity">OCA/contract</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/17.0/contract_variable_quantity">OCA/contract</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> <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>
</div> </div>