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.

2

How to fix inherited view? (SOLVED)

By
Anirudh Lou
on 11/12/14, 2:32 AM 637 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'),
    }
stock_move()

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"/>
                                                 </tree>
                                     </field>
                                     <field name="note" placeholder="Add an internal note..." class="oe_inline"/>
                    </page>
                </xpath>
            </field>
        </record>

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

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

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