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.

1

How to create a view which is same as the Opportunity tree view.?

By
NIKHIL KRISHNAN
on 7/16/16, 7:36 AM 216 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')
1
NIKHIL KRISHNAN
On 7/19/16, 11:44 PM

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

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: 7/16/16, 7:36 AM
Seen: 216 times
Last updated: 7/20/16, 5:57 AM