You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
676 B

  1. # Copyright 2018 ACSONE SA/NV
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, models, fields
  4. class AccountAbstractAnalyticContractLine(models.AbstractModel):
  5. _inherit = 'account.abstract.analytic.contract.line'
  6. @api.onchange('product_id')
  7. def onchange_product(self):
  8. if self.product_id.is_contract:
  9. self.recurring_rule_type = self.product_id.recurring_rule_type
  10. self.recurring_invoicing_type = (
  11. self.product_id.recurring_invoicing_type
  12. )
  13. self.recurring_interval = self.product_id.recurring_interval
  14. self.date_start = fields.Date.today()