Hi, i'm trying to make products packs, so I made a boolean button in the product to check if the product is a pack, now i want to make an onchange to change the type of the prodcut to service if pack checkbox is true. I'm trying with this but is not working.
class product_template(models.Model):
_inherit = 'product.template'
pack = fields.Boolean('Pack?')
api.onchange('pack')
def _onchange_pack(self):
if self.pack:
self.type = 'service'