Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8877 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks that worked with me.

Tác giả

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.

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
Many2many fields Đã xử lý
2
thg 3 23
3696
2
thg 7 22
2512
0
thg 9 23
1794
2
thg 4 23
6151
1
thg 12 22
6179