diff --git a/contract_price_revision/README.rst b/contract_price_revision/README.rst index fc60b633f..90af786be 100644 --- a/contract_price_revision/README.rst +++ b/contract_price_revision/README.rst @@ -14,13 +14,13 @@ Contract Price Revision :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github - :target: https://github.com/OCA/contract/tree/12.0/contract_price_revision + :target: https://github.com/OCA/contract/tree/13.0/contract_price_revision :alt: OCA/contract .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_price_revision + :target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_price_revision :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/110/12.0 + :target: https://runbot.odoo-community.org/runbot/110/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -50,13 +50,17 @@ To use this module: #. When create invoices related to contracts selected, prices will be update with the prices that are not out of date. +#. When managing contract with recurrence on line level, you maybe want not + to revise price for some lines. + Check 'Never Revise Price' on line level to avoid price revisions. + Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -66,6 +70,7 @@ Credits Authors ~~~~~~~ +* ACSONE SA/NV * Tecnativa Contributors @@ -97,6 +102,6 @@ Current `maintainer `__: |maintainer-carlosdauden| -This module is part of the `OCA/contract `_ project on GitHub. +This module is part of the `OCA/contract `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_price_revision/models/contract_line.py b/contract_price_revision/models/contract_line.py index 2f9a3d791..95e35047d 100644 --- a/contract_price_revision/models/contract_line.py +++ b/contract_price_revision/models/contract_line.py @@ -20,6 +20,9 @@ class ContractLine(models.Model): string="Variation %", ) + never_revise_price = fields.Boolean( + help="Check this if you don't want to allow price revision." + ) price_can_be_revised = fields.Boolean( compute="_compute_price_can_be_revised", help="Technical field in order to know if the line price can be revised.", @@ -29,7 +32,8 @@ class ContractLine(models.Model): def _compute_price_can_be_revised(self): date_start = self.env.context.get("date_start", fields.Datetime.now()) lines_can_be_revised = self.filtered( - lambda line: not line.automatic_price + lambda line: not line.never_revise_price + and not line.automatic_price and not line.successor_contract_line_id and line.recurring_next_date and not line.display_type diff --git a/contract_price_revision/readme/USAGE.rst b/contract_price_revision/readme/USAGE.rst index b256f9a54..544bbeeef 100644 --- a/contract_price_revision/readme/USAGE.rst +++ b/contract_price_revision/readme/USAGE.rst @@ -12,3 +12,7 @@ To use this module: will have as ending date the day before the entered date. #. When create invoices related to contracts selected, prices will be update with the prices that are not out of date. + +#. When managing contract with recurrence on line level, you maybe want not + to revise price for some lines. + Check 'Never Revise Price' on line level to avoid price revisions. diff --git a/contract_price_revision/static/description/index.html b/contract_price_revision/static/description/index.html index c6507a431..9a8277128 100644 --- a/contract_price_revision/static/description/index.html +++ b/contract_price_revision/static/description/index.html @@ -3,7 +3,7 @@ - + Contract Price Revision