|
@ -79,6 +79,7 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel): |
|
|
help="Repeat every (Days/Week/Month/Year)", |
|
|
help="Repeat every (Days/Week/Month/Year)", |
|
|
required=True, |
|
|
required=True, |
|
|
) |
|
|
) |
|
|
|
|
|
date_start = fields.Date(string='Date Start') |
|
|
recurring_next_date = fields.Date(string='Date of Next Invoice') |
|
|
recurring_next_date = fields.Date(string='Date of Next Invoice') |
|
|
|
|
|
|
|
|
is_canceled = fields.Boolean(string="Canceled", default=False) |
|
|
is_canceled = fields.Boolean(string="Canceled", default=False) |
|
@ -204,3 +205,23 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel): |
|
|
vals['price_unit'] = product.price |
|
|
vals['price_unit'] = product.price |
|
|
self.update(vals) |
|
|
self.update(vals) |
|
|
return {'domain': domain} |
|
|
return {'domain': domain} |
|
|
|
|
|
|
|
|
|
|
|
@api.onchange('product_id') |
|
|
|
|
|
def _onchange_product_id_recurring_info(self): |
|
|
|
|
|
for rec in self: |
|
|
|
|
|
rec.date_start = fields.Date.today() |
|
|
|
|
|
if rec.product_id.is_contract: |
|
|
|
|
|
rec.recurring_rule_type = rec.product_id.recurring_rule_type |
|
|
|
|
|
rec.recurring_invoicing_type = ( |
|
|
|
|
|
rec.product_id.recurring_invoicing_type |
|
|
|
|
|
) |
|
|
|
|
|
rec.recurring_interval = rec.product_id.recurring_interval |
|
|
|
|
|
rec.is_auto_renew = rec.product_id.is_auto_renew |
|
|
|
|
|
rec.auto_renew_interval = rec.product_id.auto_renew_interval |
|
|
|
|
|
rec.auto_renew_rule_type = rec.product_id.auto_renew_rule_type |
|
|
|
|
|
rec.termination_notice_interval = ( |
|
|
|
|
|
rec.product_id.termination_notice_interval |
|
|
|
|
|
) |
|
|
|
|
|
rec.termination_notice_rule_type = ( |
|
|
|
|
|
rec.product_id.termination_notice_rule_type |
|
|
|
|
|
) |