Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
2604 Представления

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

Related Posts Ответы Просмотры Активность
0
апр. 22
2648
1
июн. 25
1672
3
июл. 25
3296
1
мая 25
1436
1
мая 25
1692