Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4073 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
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.

Gerelateerde posts Antwoorden Weergaven Activiteit
2
jun. 25
1641
0
mrt. 25
1516
0
feb. 25
1152
3
aug. 24
5853
1
apr. 24
33