[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
parent de369d4323
commit ef2dc5345f
11 changed files with 248 additions and 125 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"