Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3020 Tampilan

 How to replace a value in a selection field by keeping all its properties (linkings and computations) intact in the existing model, i.e. the new added value should inherit all the properties of the replaced value.

Avatar
Buang
Jawaban Terbai

Hi,

If you just need to change the value displayed to the end user, you can easily achieve it as follows:

1. Inherit the model, in your custom module

2. Using selection_add and keeping the same selection_key, replace the value with new value.


See a sample of changing the type in stock picking type model:

code = fields.Selection(selection_add=[
('incoming', 'New Value')
])


Thanks

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
4
Mar 24
3363
1
Okt 23
5329
4
Des 23
22255
5
Jul 24
15620
1
Jun 22
6565