[IMP] - Should be able to stop a past contract line

This commit is contained in:
sbejaoui
2019-01-11 15:45:39 +01:00
committed by Francisco Ivan Anton Prieto
parent 664ed4346f
commit ae2bf92694
3 changed files with 8 additions and 12 deletions

View File

@@ -999,7 +999,7 @@ class AccountAnalyticInvoiceLine(models.Model):
res = self.env['account.analytic.invoice.line']
for rec in self:
is_auto_renew = rec.is_auto_renew
rec.is_auto_renew = False
rec.stop(rec.date_end, post_message=False)
date_start, date_end = rec._get_renewal_dates()
new_line = rec.plan_successor(
date_start, date_end, is_auto_renew, post_message=False