コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2619 ビュー

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
2677
1
6月 25
1682
3
7月 25
3307
1
5月 25
1448
1
5月 25
1711