xml - How to add a field to sale order lines? -
i add "ship" field sale order lines drop down list (many2one field).
my xml file ship_view.xml:
<record model="ir.ui.view" id="ship_orderline"> <field name="model">sale.order.line</field> <field name="name">sale.form</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <xpath expr="//field[@name='order_line']/tree/field[@name='product_uom_qty']" position="before"> <field name="ship"/> </xpath> </field> </record>
try belowing code. check out model should sale.order
in view:
python code
from openerp import models, fields class customsaleorderline(models.model): _inherit = 'sale.order.line' ship = fields.char( string='ship', )
xml view
<record model="ir.ui.view" id="ship_orderline"> <field name="model">sale.order</field> <field name="name">sale.order.form</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="before"> <field name="ship"/> </xpath> </field> </record>
Comments
Post a Comment