跳至內容
選單
此問題已被標幟
3048 瀏覽次數

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?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 24
2787
3
12月 19
5743
0
4月 19
3622
2
7月 24
1625
2
8月 23
4201