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

I have made a new tab in res.partner so that I can see in what events the customer is registred.

How can I filter this in this tab, so that I see all events the customer is in?


 <?xml version="1.0" encoding="utf-8"?>
<openerp>
 <data>
 <record model="ir.ui.view" id="res_partner_view">
 <field name="name">res.partner.form</field>
 <field name="model">res.partner</field>
 <field name="inherit_id" ref="base.view_partner_form"/>
 <field name="arch" type="xml">
 <xpath expr="//notebook[last()]" position="inside">
 <page string="Events">
 <!--<field name="testing" domain="('registration_ids', '=', customer)"/>-->
 </page>
 </xpath>
 </field>
 </record>
 </data>
</openerp>



# -*- coding: utf-8 -*-
from openerp import models, fields
 class res_partner(models.Model):
 _inherit = ["res.partner"]
 testing = fields.Many2many('event.event', 'registration')


How can I solve that?



Thank you very much

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

Your field definition is incomplete but Odoo seems to complete the rest for you. As a m2m field the events will appear after they are added to the m2m field. It seems that you need to use an o2m field to show existing events of the partners or just convert the m2m field into a computed field to search for the ids of the events

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

can you give me an example of the search ids for the events?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 22
2981
0
thg 12 22
2865
3
thg 4 17
3038
0
thg 3 16
4917
1
thg 3 15
4700