跳至內容
選單
此問題已被標幟
1 回覆
2992 瀏覽次數

 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.

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
4
3月 24
3344
1
10月 23
5309
4
12月 23
22244
5
7月 24
15600
1
6月 22
6552