[IMP] contract: support pre-paid for monthlylastday

monthlylastday is (almost) not a special case anymore \o/.
montlylastday is simply a montly period where the
periods are aligned on month boundaries.
The last bit of special casing is that postpaid generates
invoice the day after the last dasy of the period, except
for monthlylastday where the invoice is generated on the
last day of the period. This last exception will disappear
when we put the offset under user control.

This is a breaking change because the post-paid/pre-paid
mode becomes relevant for monthlylastday invoicing.
The field becomes visible in the UI. Code that generate
monthlylastday contract lines must now correctly set
the pre-paid/post-paid mode too. Some tests have had
to be adapted to reflect that.
This commit is contained in:
Stéphane Bidoul (ACSONE)
2019-12-08 12:31:04 +01:00
committed by Ilyas
parent 5d7f879a98
commit 6977906e13
3 changed files with 3 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ class TestSaleOrder(TransactionCase):
'is_contract': True, 'is_contract': True,
'default_qty': 12, 'default_qty': 12,
'recurring_rule_type': "monthlylastday", 'recurring_rule_type': "monthlylastday",
'recurring_invoicing_type': "post-paid",
'contract_template_id': self.contract_template1.id, 'contract_template_id': self.contract_template1.id,
} }
) )

View File

@@ -33,8 +33,7 @@
</group> </group>
<group> <group>
<field name="default_qty"/> <field name="default_qty"/>
<field name="recurring_invoicing_type" <field name="recurring_invoicing_type"/>
attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
</group> </group>
</group> </group>
<group> <group>

View File

@@ -58,8 +58,7 @@
<field name="recurring_rule_type"/> <field name="recurring_rule_type"/>
</group> </group>
<group attrs="{'invisible': [('is_contract', '=', False)]}"> <group attrs="{'invisible': [('is_contract', '=', False)]}">
<field name="recurring_invoicing_type" <field name="recurring_invoicing_type"/>
attrs="{'invisible': [('recurring_rule_type', '=', 'monthlylastday')]}"/>
</group> </group>
<group attrs="{'invisible': [('is_contract', '=', False)]}"> <group attrs="{'invisible': [('is_contract', '=', False)]}">
<field name="date_start" <field name="date_start"