Browse Source

[REM] - Remove unused method

pull/208/head
sbejaoui 6 years ago
committed by Thomas Binsfeld
parent
commit
d4f6c9b97c
  1. 1
      product_contract/models/__init__.py
  2. 27
      product_contract/models/abstract_contract_line.py
  3. 4
      product_contract/models/sale_order_line.py

1
product_contract/models/__init__.py

@ -2,7 +2,6 @@
# Copyright 2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import abstract_contract_line
from . import contract_line
from . import product_template
from . import sale_order

27
product_contract/models/abstract_contract_line.py

@ -1,27 +0,0 @@
# 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()
self.is_auto_renew = self.product_id.is_auto_renew
self.auto_renew_interval = self.product_id.auto_renew_interval
self.auto_renew_rule_type = self.product_id.auto_renew_rule_type
self.termination_notice_interval = (
self.product_id.termination_notice_interval
)
self.termination_notice_rule_type = (
self.product_id.termination_notice_rule_type
)

4
product_contract/models/sale_order_line.py

@ -72,7 +72,7 @@ class SaleOrderLine(models.Model):
)
rec.recurring_interval = rec.product_id.recurring_interval
rec.date_start = rec.date_start or fields.Date.today()
if rec.is_auto_renew:
if rec.product_id.is_auto_renew:
rec.date_end = (
rec.date_start
+ contract_line_env.get_relative_delta(
@ -85,7 +85,7 @@ class SaleOrderLine(models.Model):
@api.onchange('date_start')
def onchange_date_start(self):
for rec in self:
if rec.is_auto_renew:
if rec.product_id.is_auto_renew:
if not rec.date_start:
rec.date_end = False
else:

Loading…
Cancel
Save