Odoo Help


Display stock availability in quotation view

on 3/8/16, 11:44 PM 463 views

Odoo 9 community edition


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



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">
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="qty_available"/>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="qty_available"/>

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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