mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] - Onchange contract product on contract contract and contract template
This commit is contained in:
committed by
Thomas Binsfeld
parent
c4f189a1d2
commit
ffef4c1c25
@@ -2,6 +2,7 @@
|
|||||||
# Copyright 2017 LasLabs Inc.
|
# Copyright 2017 LasLabs Inc.
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from . import abstract_contract_line
|
||||||
from . import contract_line
|
from . import contract_line
|
||||||
from . import product_template
|
from . import product_template
|
||||||
from . import sale_order
|
from . import sale_order
|
||||||
|
|||||||
18
product_contract/models/abstract_contract_line.py
Normal file
18
product_contract/models/abstract_contract_line.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Copyright 2018 ACSONE SA/NV
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import api, models, fields
|
||||||
|
|
||||||
|
|
||||||
|
class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
||||||
|
_inherit = 'account.abstract.analytic.contract.line'
|
||||||
|
|
||||||
|
@api.onchange('product_id')
|
||||||
|
def onchange_product(self):
|
||||||
|
if self.product_id.is_contract:
|
||||||
|
self.recurring_rule_type = self.product_id.recurring_rule_type
|
||||||
|
self.recurring_invoicing_type = (
|
||||||
|
self.product_id.recurring_invoicing_type
|
||||||
|
)
|
||||||
|
self.recurring_interval = self.product_id.recurring_interval
|
||||||
|
self.date_start = fields.Date.today()
|
||||||
Reference in New Issue
Block a user