Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2625 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Autor Nejlepší odpověď

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)])


Avatar
Zrušit

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

Related Posts Odpovědi Zobrazení Aktivita
0
dub 22
2685
1
čvn 25
1694
3
čvc 25
3323
1
kvě 25
1462
1
kvě 25
1725