Skip to Content
Menu
This question has been flagged
1 Atsakyti
4945 Rodiniai

Odoo 9 community edition


Hi,

I'm new in Odoo/Openerp. How do I enable stock availability in Sales Quotation View?


Thanks!

Jing

Portretas
Atmesti
Best Answer

Use below code,

In PYTHON file:

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
qty_available = fields.Float(related='product_id.qty_available', string="Qty Available", readonly=True)

In XML file:

     <record id="view_order_form_inherit" model="ir.ui.view">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="qty_available"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="qty_available"/>
</xpath>
</data>
</field>
</record>

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
bal. 25
2618
0
liep. 24
1837
0
lapkr. 23
1053
1
vas. 22
2097
1
birž. 21
4616