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

Hi,

when the checkbox is true in Purchase Order Line i need to enable the 'readonly'. So for, i have added one checkbox in PO header, on PO line i have one button when this button is clicked the checkbox value will be set to 'True'. Based on this checkbox  value i enable the 'readonly' But it does not works for me.

Eg:

In xml,

                        <xpath expr="/form/sheet/notebook/page[1]/field[@name='order_line']" position="attributes"
  <attribute name="attrs">{'readonly':[('edit_line','=','False')]}</attribute>

</xpath>

can anyone guide me to resolve this..

Ảnh đại diện
Huỷ bỏ

you have'nt closed xpath tag is it copying error

<xpath expr="/form/sheet/notebook/page[1]/field[@name='order_line']" position="attributes"

I think in your case, the check box is in sale.order model. You didn't get that check box value directly into the sale.order.line model.

Solution: You can use the context passing method.

Hello have you created field of edit_line on

PO ?

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

Hello please check the following link :

http://232197-10-0-30ce0f.runbot5.odoo.com/web?debug#view_type=form&model=purchase.order&action=988&menu_id=689

'edit_line' field should be  invisible or visible on Form view, then after you can put the domain on PO's other fields 
 
<xpath expr="//field[@name='order_line']" position="before">
   <field name="edit_line" />
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
      <attribute name="attrs">{'readonly':[('edit_line','=', False)]}</attribute>
</xpath>
I hope it will helpful for you 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 22
2525
1
thg 10 17
3951
0
thg 7 19
4112
2
thg 6 24
1595
1
thg 12 23
1312