[IMP] base_calendar: overwrite search method to make 'my meeting' filter accurate
bzr revid: cha@tinyerp.com-20130305100145-q3k23ydf955xcjpw
This commit is contained in:
parent
339b66e807
commit
abcbdd8df5
|
@ -65,6 +65,15 @@ class crm_meeting(base_state, osv.Model):
|
|||
_defaults = {
|
||||
'state': 'open',
|
||||
}
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False):
|
||||
partner_id = self.pool.get('res.users').browse(cr, uid, uid, context).partner_id.id
|
||||
if context.get('mymeetings',False):
|
||||
args.append('|')
|
||||
args.append(['partner_ids', 'in', partner_id])
|
||||
args.append(['user_id', '=', uid])
|
||||
ids = super(crm_meeting, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)
|
||||
return ids
|
||||
|
||||
def message_get_subscription_data(self, cr, uid, ids, context=None):
|
||||
res = {}
|
||||
|
|
|
@ -238,7 +238,7 @@
|
|||
<field name="categ_ids"/>
|
||||
<field name="user_id"/>
|
||||
<separator/>
|
||||
<filter string="My Meetings" help="My Meetings" domain="[('user_id','=',uid)]"/>
|
||||
<filter string="My Meetings" help="My Meetings" name="mymeetings" context='{"mymeetings": 1}'/>
|
||||
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -252,7 +252,7 @@
|
|||
<field name="view_mode">calendar,tree,form,gantt</field>
|
||||
<field name="view_id" ref="view_crm_meeting_calendar"/>
|
||||
<field name="search_view_id" ref="view_crm_meeting_search"/>
|
||||
<field name="context">{"calendar_default_user_id": uid}</field>
|
||||
<field name="context">{"search_default_mymeetings": 1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to schedule a new meeting.
|
||||
|
|
Loading…
Reference in New Issue