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

View Inheritance to New Module

By
David
on 12/4/13, 8:04 PM 1,202 views

Hi all,

I've been searching for this answer for a couple days, and have yet to find a solution that works. I am creating a new module that essentially mimicks the lead to invoice process, except with an emphasis on repairs workflow.

In essence, I've created a new module

    class repairs_lead(osv.osv):

    _name='repairs.lead'
    _inherit = 'crm.lead'

    repairs_lead()

Now I would like to create a new menu system, but I am struggling to import the views as they exist. My starting point as you can see is crm.lead, and my first goal is to reproduce the appearance of crm.lead, except under the model repairs.lead.

My XML so far:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="repairs_lead_form_inherit" model="ir.ui.view">
<field name="name">repairs.lead.form.inherit</field>
<field name="model">repairs.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
<field name="arch" type="xml"> </field>
</record>

<record id="repairs_lead_tree_inherit" model="ir.ui.view">
<field name="name">repairs.lead.tree.inherit</field>
<field name="model">repairs.lead</field>
<field name="inherit_id" ref="crm.crm_case_tree_view_leads"/>
<field name="arch" type="xml">
</field>
</record>

<record id="action_repairs_leads" model="ir.actions.act_window">
<field name="name">Repairs</field>
<field name="res_model">repairs.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record><menuitem id="repairs_menu_top" name="Repairs"/>
<menuitem id="repairs_submenu" name="Repairs Sub" parent="repairs_menu_top"/>
<menuitem id="repairs_menu" name="Repairs Lead" parent="repairs_submenu" action="action_repairs_leads"/>
</data>
</openerp>

Thank you for your help.

any thoughts?

David
on 12/10/13, 3:50 PM
0

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 6/7/16, 2:35 AM

Hi,

Here you created new object 'repair.lead' which inherit 'crm.lead'. This is classical inheritance, here 'repair.lead' inherit all fields and methods of 'crm.lead'.

You can also override 'crm.lead' fields and methods.

You can't use existing view of 'crm.lead' for 'repair.lead', you have to create your own views for 'repair.lead'.


Hope this helps.

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

2 follower(s)

Stats

Asked: 12/4/13, 8:04 PM
Seen: 1202 times
Last updated: 6/7/16, 2:35 AM