Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 24
2757
3
gru 19
5722
0
kwi 19
3591
2
lip 24
1592
2
sie 23
4133