Odoo Help


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.


How to display prices and values in stock.inventory?

Pascal Tremblay
on 1/17/16, 1:55 PM 539 views

Hello guys,

We are on Odoo 8. In Warehouse->Inventory Control-­­>Inventory Adjustements

The view is stock.view_inventory_form at this place.

Is it possible to display prices and values for each inventory line there?




| 5 4 7
Lodz, Poland

On 1/18/16, 6:07 AM

My solution (with current cost price, not history):

class stock_inventory_line(models.Model):
    _inherit = 'stock.inventory.line'

    def _get_value(self):
        self.value = self.price * self.product_qty

    price = fields.Float(string='Cost price',related='product_id.standard_price',radonly=True,company_dependent=True)
    value = fields.Float(string='Value',compute='_get_value')

unfortunately company_dependent=True - see issue https://github.com/odoo/odoo/issues/9450

Update #1

In the view :

<record id="view_inventory_form_inherit_pt" model="ir.ui.view">

    <field name="name">stock.inventory.form.inherit.pt</field>

    <field name="model">stock.inventory</field>

    <field name="inherit_id" ref="stock.view_inventory_form"/>

    <field name="arch" type="xml">

    <xpath expr="//field[@name='theoretical_qty']" position="after">

            <field name="value"/>




what a beast. I will see it soon. thanks.

Pascal Tremblay
on 1/18/16, 7:25 AM

Great, it works the first shot! Thanks a lot my friend.

Pascal Tremblay
on 1/18/16, 8:15 AM

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)


Asked: 1/17/16, 1:55 PM
Seen: 539 times
Last updated: 1/18/16, 8:15 AM