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

I created a function that computes the internal reference I need so I need directions on how to add it to the internal reference field. Thanks in advance :)

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

Hi,

Inherit the corresponding model and add the compute to corresponding field.

class ModelName(models.Model):
_inherit = "model.name"

so_line = fields.Char(compute='_compute_function_name')

To do it from user interface, use automated actions in odoo. See a use case here: https://www.youtube.com/watch?v=Cz5eM5FDmTE&list=PLqRRLx0cl0hq6DeOzGlfHyjgBxjN5jW90&index=1


Thanks

อวตาร
ละทิ้ง
ผู้เขียน

So if the id of the internal reference is "default_code" do I write it instead of "so_line"? Will that override it?

คำตอบที่ดีที่สุด

For an option that does not  require you to build a module, and leverages the SEQUENCE model, see https://www.odoo.com/forum/help-1/question/can-i-assign-a-custom-field-the-value-of-a-sequence-without-a-module-143107

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 24
2593
2
มี.ค. 24
1993
0
ธ.ค. 22
1611
2
พ.ย. 19
6933
1
พ.ค. 17
3353