mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[REM] - Remove unused method
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
# 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
|
||||||
|
|||||||
@@ -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
|
|
||||||
)
|
|
||||||
@@ -72,7 +72,7 @@ class SaleOrderLine(models.Model):
|
|||||||
)
|
)
|
||||||
rec.recurring_interval = rec.product_id.recurring_interval
|
rec.recurring_interval = rec.product_id.recurring_interval
|
||||||
rec.date_start = rec.date_start or fields.Date.today()
|
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_end = (
|
||||||
rec.date_start
|
rec.date_start
|
||||||
+ contract_line_env.get_relative_delta(
|
+ contract_line_env.get_relative_delta(
|
||||||
@@ -85,7 +85,7 @@ class SaleOrderLine(models.Model):
|
|||||||
@api.onchange('date_start')
|
@api.onchange('date_start')
|
||||||
def onchange_date_start(self):
|
def onchange_date_start(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.is_auto_renew:
|
if rec.product_id.is_auto_renew:
|
||||||
if not rec.date_start:
|
if not rec.date_start:
|
||||||
rec.date_end = False
|
rec.date_end = False
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user