1) Extend option at last. your_selection_field = fields.Selection( selection_add=[ ('new_value', 'New Value'), ], ) 2) Override options using like this. your_selection_field = fields.Selection( [ ('A', 'A'), ('B', 'B'), ('D', 'D'), # Adding the new option here Before 'C' ('C', 'C'), ], string="Your Selection Field", ) 3) Before C option you can add new option as D your_selection_field = fields.Selection( selection_add = [('D', 'D'), ('C',)] string="Your Selection Field", )
You want to learn more about Odoo inheritance, please check below link.
ua-cam.com/play/PLAR8TpPnVeTSfczpIKvh_ZvdD8G1yT2EF.html
DonateUS :-
ko-fi.com/weblearns
paypal.me/weblearners
For business inquiry :- inquiryweblearns@gmail.com
Source Code :- github.com/er-harsh-dhaduk/odoo-training
Subscribe - Share - Comment/Suggestion - Enjoy - DonateUS
very very good explanation........especially for who doesn't know what is inheritance in odoo.
Thank you🌹🙏❤
Thank you very much how to add a new option value inside selection field. For standard models. Inside or attribute ?
1) Extend option at last.
your_selection_field = fields.Selection(
selection_add=[
('new_value', 'New Value'),
],
)
2) Override options using like this.
your_selection_field = fields.Selection(
[
('A', 'A'),
('B', 'B'),
('D', 'D'), # Adding the new option here Before 'C'
('C', 'C'),
],
string="Your Selection Field",
)
3) Before C option you can add new option as D
your_selection_field = fields.Selection(
selection_add = [('D', 'D'), ('C',)]
string="Your Selection Field",
)
how can i do something like the school_inherit_views without scaffold
ua-cam.com/play/PLAR8TpPnVeTSfczpIKvh_ZvdD8G1yT2EF.html
Pls check this playlist.
How to identify view and how to add element to the existing view ?
Well its explained already please refer view related playlist :)
Outstanding