Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4157 Vues

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'


Avatar
Ignorer
Meilleure réponse

Hi,

Try to make the on change function in the product.product model. Also it will be helpful if you put the error msg and your version ...


Avatar
Ignorer
Auteur

I don't have any error, it does nothing, is in V8. I'll try to do it in the product.product and see if it works.

Publications associées Réponses Vues Activité
1
août 25
404
2
juin 25
1827
0
mars 25
1691
0
févr. 25
1331
3
août 24
6057