Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Display stock availability in quotation view

By
Jing
on 3/8/16, 11:44 PM 377 views

Odoo 9 community edition


Hi,

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


Thanks!

Jing

0
CatsandDogs
On 3/9/16, 1:04 AM

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>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/8/16, 11:44 PM
Seen: 377 times
Last updated: 3/9/16, 1:04 AM