Files
contract/agreement_serviceprofile/models/product.py
Maxime Chambreuil b9cd46f28d [FIX] agreement_serviceprofile: Github Issue #370
[UPD] Update agreement_serviceprofile.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: contract-12.0/contract-12.0-agreement_serviceprofile
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_serviceprofile/

Translated using Weblate (French)

Currently translated at 100.0% (27 of 27 strings)

Translation: contract-12.0/contract-12.0-agreement_serviceprofile
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_serviceprofile/fr/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (27 of 27 strings)

Translation: contract-12.0/contract-12.0-agreement_serviceprofile
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_serviceprofile/zh_CN/
2021-05-04 14:06:36 -06:00

19 lines
583 B
Python

# Copyright (C) 2019 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_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.""")
@api.onchange('is_serviceprofile')
def onchange_type(self):
if self.is_serviceprofile:
self.type = 'service'