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

Hello,


I created a field in the BILL OF MATERIAL and want to show it as readonly in the work order form so may anyone help.


Waiting for a reply!

Thanks in advance.

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

Hi,

You can add a related field for this, suppose if you have a field named field_1 in bom model and if you need to show the same in the work order form, add a new field to work order model and give relation as this:

field_1 = fields.Char(related='production_id.bom_id.field_1')

To know more about related fields in odoo, see: https://www.youtube.com/watch?v=rLlUQ9GAan8

Thanks

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

Thanks that worked with me.

ผู้เขียน

Hello, I have another question .

I wanted to add a field to enter how many times the user can print the report and if he want to exceed the number entered to the field he will get a maasage saying you cant print reports anymore. So can you help please.

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

Hello,
Here is the example of related field.
Ex.
number = fields.Char(related='partner_id.phone', string='Number')
If you can get phone number from customer, you add related field like this.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Many2many fields แก้ไขแล้ว
2
มี.ค. 23
3862
2
ก.ค. 22
2650
0
ก.ย. 23
1947
2
เม.ย. 23
6269
1
ธ.ค. 22
6481