contract
contract copied to clipboard
[12.0][Bug] The "recurring_next_date" of contract line is not set after renewing this line.
Module
- contract
Describe the bug
The "recurring_next_date" of contract line is not set after renewing this line.
To Reproduce
Affected versions: 12.0 (I just tested in 12.0, so I don't know if this also affects other versions.)
Steps to reproduce the behavior:
- Create a contract for a customer / supplier.
- Add a product and choose monthly invoicing by setting recurring_interval = 1 and recurring_rule_type = "monthly".
- Set the start date to 2021-01-01 (or something else in the past for testing purpose).
- Set is_auto_renew = True, and then auto_renew_interval = 3 and auto_renew_rule_type = "monthly".
- Create the 3 invoices by using the cron job or by clicking on "create invoice" button (with developer mode).
- Now, I need to renew my contract line because I created the invoice for january, february and march. So, I click on "renew" on the contract line or use the cronjob.
- The new end date is correctly set to 2021-06-30, the next_period_date_start is correctly set to 2021-04-01 and the next_period_date_end is correctly set 2021-04-30. So far, everything is fine.
- BUT: The recurring_next_date is not set (should be 2021-04-01), and therefore the field create_invoice_visibility is still False. And that is why my contract is not displayed as "in progress" and I cannot see the "create invoice" button anymore, even though I am in the developer mode. The cronjob to automatically create the invoice also does nothing.
Expected behavior After clicking on "renew" on a contract line or using the cronjob the recurring_next_date should be set to next invoicing date.