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

class parent 

category_id many2one

child_ids


class child 

parent_id

product_id


so,on select category at parent form view 

then select only product related to category

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

Hi,
Please try with the below domain. Add it into the child product id field.

         domain="[('category_id', '=', parent.category_id)]"

Hope it will help you.
Up vote please.

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

Invalid composed field farm_materials.category_id in domain of ([('categ_id', '=', farm_materials.category_id)])


also

ValueError: Invalid composed field materials.category_id in domain of ([('categ_id', '=', materials.category_id)])


الصورة الرمزية
إهمال

No Not that way.
you have to use the "parent" key on a right side of the domain. Not 'farm_materials' or 'materials'.

please take the reference from here :

https://github.com/odoo/odoo/blob/15.0/addons/account/views/account_move_views.xml#L902

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 22
2675
1
يونيو 25
1680
3
يوليو 25
3304
1
مايو 25
1448
1
مايو 25
1709