Skip to Content
Menu
This question has been flagged
2 Replies
2592 Rodiniai

The new key should not be added at the end. it should be added in the middle.For example, Assume that we have draft,quotation,order in state(selection) field. I need to add new key as 'verification' before 'order' key in selection field.
Any Solution?

Portretas
Atmesti

I think it you need to add in the middle, then you might have to rewrite the field with new selections instead of using selection_add

Best Answer

Create new class that inherits your base class, overwrite your state fields as below:

state = fields.Selection(selection_add=[('verifcation', 'Verification'), ('order',)])

You can search with 'selection_add' in Odoo base(fields.py), to see more details in Odoo 13.

Portretas
Atmesti
Best Answer

The Selection field accepts a method so provide that method to the selection value create a method and return the values in the order that you want.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
rugp. 25
2541
1
liep. 25
958
1
rugp. 25
1151
0
geg. 25
1401
2
bal. 25
3592