[14.0][MIG] agreement_serviceprofile (Version 12.0 to 14.0)

[MIG] Black

[MIG] Black
This commit is contained in:
Patrick Wilson
2021-05-04 13:49:14 -06:00
committed by Olga Marco
parent 7a4e3df740
commit 2e19f4a2ba
14 changed files with 290 additions and 147 deletions

View File

@@ -5,28 +5,30 @@ from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
_inherit = "product.template"
is_serviceprofile = fields.Boolean(
string="Create Service Profiles",
help="""If True, this product will create a service profile on the
agreement when the sales order is confirmed.""")
agreement when the sales order is confirmed.""",
)
@api.onchange('is_serviceprofile')
@api.onchange("is_serviceprofile")
def onchange_type(self):
if self.is_serviceprofile:
self.type = 'service'
self.type = "service"
class ProductProduct(models.Model):
_inherit = 'product.product'
_inherit = "product.product"
is_serviceprofile = fields.Boolean(
string="Create Service Profiles",
help="""If True, this product will create a service profile on the
agreement when the sales order is confirmed.""")
agreement when the sales order is confirmed.""",
)
@api.onchange('is_serviceprofile')
@api.onchange("is_serviceprofile")
def onchange_type(self):
if self.is_serviceprofile:
self.type = 'service'
self.type = "service"