تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4324 أدوات العرض

I am returning a dynamic domain from a server action in Odoo with the following code. Please note I am using a hosted version of Odoo online, so I am doing this through the Odoo UI. Actions are returned by assigning `action = {...}`:


action = {

    'domain': {

        'route_id': [('id', 'in', record.x_all_route_ids.ids)]

    }

}


This server action is triggered when the `product_id` field changes for a `sales.order.line`. When viewing a sales order, the sale order, if I change the product_id for one of the sales order lines, the domain for the `route_id` field is updated as expected.


However, the domain is changed for all of the `route_id` fields in the sale order line tree view. In other words, if there are 3 lines in the order, and I change the product_id for one of them, I want the domain to change for just that line's route_id field, not every route_id field in the sale order.


Is what I'm seeing the expected behavior, and is there any way to accomplish what I want instead?

الصورة الرمزية
إهمال
أفضل إجابة

Why not using OnChange function on product_id in the corresponding model

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
ديسمبر 16
3913
2
أغسطس 24
1450
0
يناير 25
1334
2
يونيو 23
1745
0
مايو 23
1793