[FIX] fleet: recurring cost => required expiration

If "Recurring Cost Amount" is set on a frequency and the date field
"Contract Expiration Date" is not set, the configuration makes no sense
since we would have an infinite cost, and infinite fleet.vehicle.cost
records and so on which is not possible.

With this changeset, the expiration will be required if there is a
recurring cost set.

opw-2036071
closes #34883

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2019-07-15 14:49:38 +00:00
parent 30b9a590fc
commit 1a62c2ed47
@@ -207,7 +207,7 @@
<group>
<field name="date" string="Invoice Date"/>
<field name="start_date"/>
<field name="expiration_date" />
<field name="expiration_date" attrs="{'required': [('cost_frequency', '!=', 'no')]}"/>
</group>
<group>
<field name="insurer_id" context="{'default_supplier': True}"/>