Bhumi Thakkar (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-576381-bth into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576381-bth/+merge/114341

Hello,

      ERROR in action "Scheduling Meeting" for customer.

1. Sales => Address Book => Customers 
2. Open any record click on action 'Scheduling Meeting'
3. Create meeting with select recurrent and in recurrency option: recurrency 
period : weekly, and select any day.
4. Open that customer

Observed: Error is coming 'invalid input syntax for integer: "10-20120720023000"
LINE 1: ...ng.id FROM "crm_meeting" WHERE crm_meeting.id IN (E'10-20120.'
Expected: Open Customer successfully and has created meetings.

Got virtual ids from search result and convert virtual ids to real ids and then 
send to read records.

Thanks.

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-576381-bth/+merge/114341
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-576381-bth.
=== modified file 'crm/res_partner.py'
--- crm/res_partner.py	2011-12-22 09:10:55 +0000
+++ crm/res_partner.py	2012-07-11 06:51:20 +0000
@@ -20,6 +20,30 @@
 ##############################################################################
 
 from osv import fields,osv
+from crm_meeting import crm_meeting
+from base_calendar import base_calendar
+
+class one2many_mod2(fields.one2many):
+
+    def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
+        if context is None:
+            context = {}
+        if not values:
+            values = {}
+        res = {}
+        for id in ids:
+            res[id] = []
+        ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids)], limit=self._limit)
+
+        realids = []
+        for i in ids2:
+            id = base_calendar.base_calendar_id2real_id(i)
+            realids.append(id)
+
+        for r in obj.pool.get(self._obj)._read_flat(cr, user, realids, [self._fields_id], context=context, load='_classic_write'):
+           res[r[self._fields_id]].append( r['id'] )
+
+        return res
 
 class res_partner(osv.osv):
     """ Inherits partner and adds CRM information in the partner form """
@@ -28,7 +52,7 @@
         'section_id': fields.many2one('crm.case.section', 'Sales Team'),
         'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
             'Leads and Opportunities'),
-        'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
+        'meeting_ids': one2many_mod2('crm.meeting', 'partner_id',\
             'Meetings'),
         'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
             'Phonecalls'),

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to