Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
2608 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur Meilleure réponse

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
Ignorer

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

Publications associées Réponses Vues Activité
0
avr. 22
2653
1
juin 25
1673
3
juil. 25
3299
1
mai 25
1439
1
mai 25
1699