跳至内容
菜单
此问题已终结
2 回复
2603 查看

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
4月 22
2646
1
6月 25
1670
3
7月 25
3294
1
5月 25
1434
1
5月 25
1691