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 inherit osv.osv_memory class?

By
HateCamel
on 5/22/15, 7:11 PM 817 views

I am trying to inherit osv_memory class:


mrp_bom.py

class mrp_config_settings(osv.osv_memory):
_inherit = 'mrp.config.settings'

_columns = {
'bom_sequence': fields.boolean('Bom Sequence'),
}

mrp_bom_view.xml

<record id="view_mrp_config_bom_sequence" model="ir.ui.view">
<field name="name">view_mrp_config_bom_sequence</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.view_mrp_config"/>
<field name="arch" type="xml">
<xpath expr="//separator[@string='Manufacturing Order']" position="after">
<label for="id" string="Bom"/>
<div>
<div>
<field name="bom_sequence" class="oe_inline"/>
<label for="bom_sequence"/>
</div>
</div>
</xpath>
</field>
</record>


I am constanly getting an error on a field that is not even in my view but as far as I can see is included in server basic mrp res_config.xml and res_config.py

'View error', u"Can't find field 'module_mrp_repair' in the following view parts composing the view of object model 'mrp.config.settings':\n * mrp settings\n * view_mrp_config_bom_sequence

Why would it throw error eventhough I didn't touch the field?





0
Yogesh
On 5/23/15, 6:48 AM

its same process to inherit wizard, your inheritance seem okay but in view you are adding field in model `mrp.config.settings` but in view you are adding that field to model `mrp.bom`.

0
HateCamel
On 5/23/15, 4:32 AM

Exactly figured that out 10min after I posted the question. Thanks mate.

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: 5/22/15, 7:11 PM
Seen: 817 times
Last updated: 5/23/15, 6:48 AM