Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
6290 มุมมอง
I need to add a new option to the status invoiced field, how can I do this?
I need that when making a credit note it is reflected as a new state to show


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
override the field you want to add option:
class YourClass(models.Model):
_inherit = 'module.model'
field = fields.Selection(
selection_add=[
("new_option", "New Option"),
]
)


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

How could I apply the activation of my new status when making a credit note?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

https://www.odoo.com/forum/help-1/add-value-in-selection-field-without-overwrite-whole-field-160683
Refer the above forum post to add a new option for the selection field in Odoo

And for updating the invoice status, you can use the _get_invoice_status(self) compute function which can be found from sale_order.py file in Sale module.

Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 22
18326
2
พ.ย. 22
3518
1
พ.ค. 25
1019
2
พ.ย. 24
2213
4
ก.พ. 24
12381