Skip to Content
Menu
This question has been flagged

Hello everyone,

I'm tackling a challenge where I need to dynamically limit the selection options within a One2Many field based on the values that have already been selected within this relationship. Specifically, I'm working on a feature that allows users to set certain custom_attributes for a product based on its selected category. These custom attributes are stored in another model (to be able to link multiple categories in future) using attribute_lines with one attribute and multiple values (similar to the default odoo attributes).



My goal would be to achieve this:


Attributes which are already set, shouldn't be suggested to the user any more.

I add sql contraint, so the user isn't allowed to set the same attribute twice, but it would be nice if the selection shows him, which attributes are missing.

Any idea how to achieve this? Thought about defining a custom one2many widget in js to filter client sided, but maybe somebody know an easier way.


Thanks in advance.

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 25
18
2
May 24
7645
2
Mar 15
6629
1
Mar 15
3534
0
Mar 15
3674