Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3023 มุมมอง

 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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
มี.ค. 24
3365
1
ต.ค. 23
5333
4
ธ.ค. 23
22259
5
ก.ค. 24
15624
1
มิ.ย. 22
6570