Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2611 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor Mejor respuesta

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
Descartar

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

Publicaciones relacionadas Respuestas Vistas Actividad
0
abr 22
2654
1
jun 25
1674
3
jul 25
3303
1
may 25
1442
1
may 25
1703