Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 25
18
2
maj 24
7779
2
mar 15
6775
1
mar 15
3639
0
mar 15
3744