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

I added a field in move_lines(stock.picking) using xpath expression.

python

class StockMove(models.Model):

    _inherit = "stock.move"

   serial_no = fields.Char(string="Serial#")

This my field to add in one2many. In my xml I added like this.

xml

<record model="ir.ui.view" id="view_picking_form_inherit_serial_no">

            <field name="name">stock.picking.serial.form</field>

            <field name="model">stock.picking</field>

            <field name="inherit_id" ref="stock.view_picking_form"/>

            <field name="arch" type="xml">

                    <xpath expr="//notebook/page/field[@name='move_lines']/tree/field[@name='product_id']" position="after">

                              <field name="serial_no"/>

                </xpath>    

            </field>

  </record>

Notes

I get a validation error the xpath expression cannot be located in the parent view.How to solve this issue?



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

Hello,

The field you are trying to change is not in tree
change your expression to

<xpath expr="//notebook/page/field[@name='move_lines']/kanban/field[@name='product_id']" position="after">

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

thanks amal

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 17
10403
1
thg 9 22
2177
4
thg 5 18
11088
0
thg 3 23
5126
2
thg 3 22
9653