In default i have some fields in selection field. if i want to add another field in selection field. then how to add it?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hello Ramanan,
The same Question is asked
Nice answer given by Atul.
Click above link for your answer.
Regards,
Anil
Go through this link:
https://www.odoo.com/forum/help-1/question/how-to-change-the-values-for-a-selection-field-72934
If your selection field is static list of tuples defined in field, then there is no way to do. If it is a method or global variable you can change it.
you can use list to add item dynamically in fields.Selection
cnt=0
list1=[]
for i in range(1900,2017):
list1.append((str(cnt),str(i)))
cnt=cnt+1
class Employee(models.Model):
_name = 'employee.details'
year=fields.Selection(list1, string='Years', required=True, copy=True)#append item
list1.append(('118','2018'))
#update item
list1[0]=('0,'1899')
#item updated automatically in field.Selection
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
5
ก.ค. 24
|
15060 | ||
Working with fields.selection values
แก้ไขแล้ว
|
|
1
มิ.ย. 22
|
26516 | |
|
9
พ.ค. 22
|
52703 | ||
|
0
ก.ค. 20
|
2614 | ||
|
0
มี.ค. 20
|
3385 |