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

  Currently, I'm working in odoo version 12.0.

  I'm facing the issue, When I invisible sale order line Description field from Tree view at that time it also invisible the section text & Note Text. 

  Code for invisible sale order line Description field:

   <xpath  expr="//page[@name=''order_lines]//tree/field[@name='name']" position="attributes">

      <attribute name="invisible">1</attribute>     ​ 

  ​  </xpath>

Can anyone help me to resolve this issue?

Thanks in advance.


                 

           


                                                                                                                                                                                                                                                                        

อวตาร
ละทิ้ง

Can you check there this is not happen due to widget assign on name field in sale order line called section_and_note_text.

ผู้เขียน

Yes, I already check for that widget. But It does not happen due to that widget.

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

Hi, 

the right code is:

 <xpath  expr="//page[@name=''order_lines]//tree/field[@name='name']" position="attributes">   

   <attribute name="invisible">1</attribute>  

<xpath>


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

who ever is facing this issue and couldn't solve:

First go to your xml file and inherit the view form:

 

then in the arch field use the xpath as below:

            1        

Now good to go.
good luck.

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

Hi,

This is happening due to the 'section_and_note_one2many'  and 'section_and_note_text' widgets. In the code they are displaying section and notes in the place of field 'name'.

You can achieve this by extend  SectionAndNoteListRenderer with following code:

_renderBodyCell: function (record, node, index, options) {
var $cell = this._super.apply(this, arguments);
if (node.attrs.name === "name" && record.model === 'sale.order.line'){
return $cell.addClass('o_hidden');
}
return $cell;
},
_getNumberOfCols: function () {
var n = this._super();
if(this.state.model === 'sale.order.line'){
n--;
}
return n;
},
_renderHeaderCell: function (node) {
if (node.attrs.name === "name" && this.state.model === 'sale.order.line'){
return;
}
else{
var $th = this._super.apply(this, arguments);
return $th;
}
}

 Thanks

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

Hi, above js doesn't work. Can you please give any other solution excluding js?

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 24
7485
1
ก.ค. 23
2481
3
มิ.ย. 23
3435
4
มิ.ย. 22
5178
2
พ.ค. 21
4071