Browse Source

[12.0][FIX] - stop update recurring_next_date

pull/445/head
sbejaoui 5 years ago
parent
commit
f48ff0ddc6
  1. 13
      contract/models/contract_line.py

13
contract/models/contract_line.py

@ -540,7 +540,7 @@ class ContractLine(models.Model):
def _onchange_date_start(self):
for rec in self.filtered('date_start'):
rec.recurring_next_date = self.get_next_invoice_date(
rec.date_start,
rec.next_period_date_start,
rec.recurring_invoicing_type,
rec.recurring_invoicing_offset,
rec.recurring_rule_type,
@ -818,6 +818,17 @@ class ContractLine(models.Model):
}
if rec.last_date_invoiced == date_end:
values['recurring_next_date'] = False
else:
values['recurring_next_date'] = \
self.get_next_invoice_date(
rec.next_period_date_start,
rec.recurring_invoicing_type,
rec.recurring_invoicing_offset,
rec.recurring_rule_type,
rec.recurring_interval,
max_date_end=date_end,
)
rec.write(values)
if post_message:
msg = _(

Loading…
Cancel
Save