Hello,
I want to create a dynamic fields.selection "A" from another value "X"
For example when the X=4; my fields.selection will be as follows :
fields.Selection(
[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), string='A', required=True)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I want to create a dynamic fields.selection "A" from another value "X"
For example when the X=4; my fields.selection will be as follows :
fields.Selection(
[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), string='A', required=True)
Selection field value will be loaded right after the Form is loaded, hence the selection values cannot be reset thereafter.
However I can suggest an alternate solution, you try it out if it meets your requirement.
Use Many2one relation "X", set the domain criteria based on your source field "Y", you can also define onchange on the field "Y", such that the domain is reset in accordance with "Y" field.
Tips: for "X" field, set widget-options to no-create, no-open etc, so that it may look like Selection, however don't set widget to Selection on "X", like I said above, selection options cannot be reset, after the form is loaded.
Thank you Deep, i will check that
Can you give me an example how i will use many2one in my case ? thank you
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up