|
|
@ -24,6 +24,14 @@ class AccountAnalyticInvoiceLine(models.Model): |
|
|
|
res['sale_line_ids'] = [(6, 0, [self.sale_order_line_id.id])] |
|
|
|
return res |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def _get_auto_renew_rule_type(self): |
|
|
|
"""monthly last day don't make sense for auto_renew_rule_type""" |
|
|
|
self.ensure_one() |
|
|
|
if self.recurring_rule_type == "monthlylastday": |
|
|
|
return "monthly" |
|
|
|
return self.recurring_rule_type |
|
|
|
|
|
|
|
@api.onchange('product_id') |
|
|
|
def _onchange_product_id_recurring_info(self): |
|
|
|
for rec in self: |
|
|
@ -36,7 +44,7 @@ class AccountAnalyticInvoiceLine(models.Model): |
|
|
|
rec.recurring_interval = 1 |
|
|
|
rec.is_auto_renew = rec.product_id.is_auto_renew |
|
|
|
rec.auto_renew_interval = rec.product_id.default_qty |
|
|
|
rec.auto_renew_rule_type = rec.product_id.recurring_rule_type |
|
|
|
rec.auto_renew_rule_type = rec._get_auto_renew_rule_type() |
|
|
|
rec.termination_notice_interval = ( |
|
|
|
rec.product_id.termination_notice_interval |
|
|
|
) |
|
|
|