[IMP] contract: Protect line recurrrency change

If you have defined several contract lines, each one with their
recurrency information, unmarking the check "Line recurrency" by mistake
and saving will make you lose the configuration in one shot, and also
modify the invoceability conditions.

Thus, it's reasonable to avoid to uncheck the mark once you have at
least one invoice issued for a contract with this mark checked.

TT47015
This commit is contained in:
Pedro M. Baeza
2024-01-09 17:51:16 +01:00
committed by Christopher Rogos
parent 8c396c4c39
commit 6ffeadf949
4 changed files with 8 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ Recurring - Contracts Management
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6acdfddf18d7472f33a0023c56017cad5683f2942c3b7fe09c8a8ff3bd7dc039
!! source digest: sha256:d05526882f94431ba595fd6ff8e8ffda579ca10ba44dee90e198a0738214edb5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png

View File

@@ -11,7 +11,7 @@
{
"name": "Recurring - Contracts Management",
"version": "16.0.2.2.0",
"version": "16.0.2.3.0",
"category": "Contract Management",
"license": "AGPL-3",
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",

View File

@@ -366,7 +366,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6acdfddf18d7472f33a0023c56017cad5683f2942c3b7fe09c8a8ff3bd7dc039
!! source digest: sha256:d05526882f94431ba595fd6ff8e8ffda579ca10ba44dee90e198a0738214edb5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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"><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"><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>This module enables contracts management with recurring

View File

@@ -148,7 +148,11 @@
</group>
</group>
<group name="recurring_invoices">
<field name="line_recurrence" class="oe_inline" />
<field
name="line_recurrence"
class="oe_inline"
attrs="{'readonly': [('line_recurrence', '=', True), ('invoice_count', '!=', 0)]}"
/>
<label for="line_recurrence" />
<group attrs="{'invisible': [('line_recurrence', '=', True)]}">
<label for="recurring_interval" />