Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3042 Представления

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?

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
апр. 24
2777
3
дек. 19
5741
0
апр. 19
3619
2
июл. 24
1615
2
авг. 23
4181