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

How to show available stock on manufacturing order?

By
Yenthe
on 3/12/15, 3:38 AM 559 views

Hi guys,

I'd like to show the available stock from a product on the manufacturing order(s) (Manufacturing > Manufacturing Orders) but I can't get this working.
In the XML file mrp_view.xml under the module mrp is a view named mrp.production.form and I want to add a field here that shows the available stock from the product.

<notebook>
                        <page string="Consumed Products">
                            <group>
                                <group string="Products to Consume1">
                                    <field name="move_lines" nolabel="1" options="{'reload_on_button': true}">
                                        <tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
                                            <field name="product_id"/>
                                            <field name="product_qty"  string="Quantity"/>
                        <field name="product_uos_qty" string="Incoming"/>
                        //NEW FIELD SHOULD BE HERE
             //.. irrelevant code

I've tried to create a new field in the view like this:

<field name="product_stock_available"/>

And in mrp.py on the model mrp.production like this:

'product_stock_available': fields.float('Product Qty Available'),

But this throws me errors. I've tried dozens of ways to get it to show up but nothing is working.. I should get the value from the model product.product (field qty_available) and this should be accessible in the view mrp.production.form (mrp_view.xml) somehow.

Could anybody tell me how to do this please?
Note: This is in OpenERP 7.

Yenthe

Hi,, did you try using functional field??

Baiju
on 3/12/15, 7:21 AM

Hi Baiju, no I haven't yet.. would this be possible? And how?

Yenthe
on 3/12/15, 8:00 AM

Anybody? I'm still looking for a solution :s

Yenthe
on 3/19/15, 3:36 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)

Stats

Asked: 3/12/15, 3:38 AM
Seen: 559 times
Last updated: 3/19/15, 3:36 AM