Skip to Content
Menu
This question has been flagged
1 Reply
1792 Views

Change Warehouse on Sale Order

User can change or select different warehouse for sale order line.
I,m trying to do the above.

i inherit sale order line:

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line' warehouses_id = fields.Many2one('stock.warehouse',string="Warehouse")
and inherit view:
 " rel="ugc">ir\.ui\.view\"\>
\ \ \ \ \sale\.line\.inherit\
\ \ \ \ \sale.order.line








but it doesn't exist as in the screen




Avatar
Discard
Best Answer

Hi Asma,

Try,

<record id="view_order_form_inherit_warehouse" model="ir.ui.view">
<field name="name">sale.order.form.sale.warehousefield>
<
field name="model">sale.orderfield>
<
field name="inherit_id" ref="sale.view_order_form"/>
<
field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="warehouse_id" options="{'no_create': True}"/>
xpath>
field>
record>


Avatar
Discard

<record id="view_order_form_inherit_warehouse" model="ir.ui.view">
<field name="name">sale.order.form.sale.warehouse</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="after">
<field name="warehouse_id" options="{'no_create': True}"/>
</xpath>
</field>
</record>

Related Posts Replies Views Activity
1
Mar 20
1993
12
Dec 18
32533
1
Jul 16
5609
1
Nov 15
4931
1
Mar 15
6241