|
@ -1,13 +1,18 @@ |
|
|
# Copyright (C) 2019 - TODAY, Open Source Integrators |
|
|
# Copyright (C) 2019 - TODAY, Open Source Integrators |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
|
from odoo import fields, models |
|
|
|
|
|
|
|
|
from odoo import api, fields, models |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProductTemplate(models.Model): |
|
|
class ProductTemplate(models.Model): |
|
|
_inherit = 'product.template' |
|
|
_inherit = 'product.template' |
|
|
|
|
|
|
|
|
is_serviceprofile = fields.Boolean( |
|
|
is_serviceprofile = fields.Boolean( |
|
|
string="Create a Service Profile", |
|
|
|
|
|
|
|
|
string="Create Service Profiles", |
|
|
help="""If True, this product will create a service profile on the |
|
|
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') |
|
|
|
|
|
def onchange_type(self): |
|
|
|
|
|
if self.is_serviceprofile: |
|
|
|
|
|
self.type = 'service' |