Odoo Help


How to fix inherited view? (SOLVED)

Anirudh Lou
on 11/12/14, 2:32 AM 1,021 views

Hello everyone, can you help me how to fix this problem! I inherited a class "stock.move" and add additional fields on it. On the view of "stock.picking" / Internal moves i modified it's original view by showing what i added on "stock.move". However, everytime i upgrade my project, the terminal says:

except_orm: ('View error', u"Can't find field 'qty_on_hand' in the following view parts composing the view of object model 'stock.picking':\n
        * mp.nine.stock.picking.form.inherited\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model").


Here is my inherited class:

class stock_move():
    _inherit = "stock.move"
    _columns = {
                'qty_available' : fields.float('Qty on hand'),
                'max_qty' : fields.float('Max Qty'),
                'ordered_qty' : fields.float('Ordered Qty'),
                'balance_qty' : fields.float('Balance Qty'),

and my inherited view for "stock.picking" goes like this:

        <record id="mp_nine_view_stock_picking_form_inherited" model="ir.ui.view">
            <field name="name">mp.nine.stock.picking.form.inherited</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_form" />
            <field eval="1" name="priority" />
            <field name="arch" type="xml">
                    <xpath expr="//page[@string='Products']" position="replace">
                             <page string="Productsssssssssssss">
                                      <field name="move_lines" context="{'address_in_id': partner_id,  'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'picking_type': 'internal'}" options='{"reload_on_button": true}'>
                                                <tree string="Products" editable="bottom">
                                                           <field name="product_id"/>
                                                          <field name="date_expected"/>
                                                          <field name="max_qty"/>
                                                          <field name="ordered_qty"/>
                                                          <field name="balance_qty"/>
                                                          <field name="qty_available"/>
                                     <field name="note" placeholder="Add an internal note..." class="oe_inline"/>

Why does it can't find my added fields? Any help, please!

Anirudh Lou
On 11/12/14, 2:38 AM

I notice that i forgot to add osv.osv/orm.Model on my class so this is the reason why i got an error.

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: 11/12/14, 2:32 AM
Seen: 1021 times
Last updated: 3/16/15, 8:10 AM