[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
parent bb21d9d208
commit 247072d1c2

View File

@@ -148,7 +148,11 @@
</group> </group>
</group> </group>
<group name="recurring_invoices"> <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" /> <label for="line_recurrence" />
<group attrs="{'invisible': [('line_recurrence', '=', True)]}"> <group attrs="{'invisible': [('line_recurrence', '=', True)]}">
<label for="recurring_interval" /> <label for="recurring_interval" />