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

Hello, I'm using Odoo 13 Community Edition.


In the product_template.py I have the onchange method:


    @api.onchange('beschichtung')

    def _onchange_beschichtung(self):

        if self.beschichtung.id == 2:

            self.route_ids = [1, 5]

        else:

            self.route_ids = [8]     


My custom field "beschichtung" in product_template.py:

beschichtung = fields.Many2one(

        'mrp.beschichtung', 'Beschichtung', required=True, help="Beschichtungsart auswählen")




If I open the common form view, the onchange method works correctly, for example if I choose the "beschichtung" id 2, the routes 1 and 5 are selected.

But when I want to create a new sale order and I want to create a new product in it or edit a product (so it opens the extended view), nothing happens if I choose a "beschichtung" id, so what is wrong?

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 24
2762
3
dec. 19
5723
0
apr. 19
3594
2
jul. 24
1596
2
aug. 23
4144