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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
feb 25
18
2
máj 24
7653
2
mar 15
6647
1
mar 15
3560
0
mar 15
3684