Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4918 Lượt xem

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')
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

     

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 15
21302
6
thg 3 15
6752
4
thg 1 24
23179
Attrs attribute Đã xử lý
2
thg 1 24
2486
0
thg 8 23
2314