This question has been flagged
2 Replies
4009 Views

In Xml

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
 <data>
 <record model="ir.actions.act_window" id="crm_todo_reminder">
 <field name="name">Todo</field>
 <field name="res_model">todo.my_todo</field>
 <field name="view_mode">tree</field>
 </record>
 <menuitem name="Todo Reminder" id="menu_crm_todo_reminder" parent="base.menu_base_partner" sequence="3" groups="base.group_sale_manager"/>
 <menuitem name="To do Reminder" id="menu_crm_leads" parent="menu_crm_todo_reminder" sequence="3" action="crm_todo_reminder"/>
 <!--************TREE VIEW******************************8-->
 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
 <field name="name">Todo Opportunities Tree</field>
 <field name="model">todo.my_todo</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="opportunity"/>
</tree>
 </field>
</record>>
</data>
</openerp>

In Python

from openerp import models, fields, api
class MyTodo(models.Model):
 _name = "todo.my_todo"
 opportunity = fields.One2many('crm.lead', 'todo', string='To DO')

class Opportunity(models.Model):
 _inherit = "crm.lead"
 todo = fields.Many2one('res.user', string='Partner')
Avatar
Discard
Author Best Answer

used " _name" to create a new table  todo_my_todo . So its inherits the table fields in a new table.  But not the data.So i just use the same table, that is crm.lead to get the data. i get the views as well as the data too..

Avatar
Discard
Best Answer

hello NIKHIL KRISHNAN,

you can inherit module like

                 _inherit  = "todo.my_todo"

than you can see same view which shown in MyTodo module

thank you

     

Avatar
Discard
Author

Thanks