From 63b6ec6050abd49262b25b84f93a5e7228817962 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Fri, 24 Sep 2010 10:46:36 +0200 Subject: [PATCH 01/12] [FIX] project_planning: revision 4965 added a bug: removed field 'child_ids' was used in project_planning module bzr revid: olt@tinyerp.com-20100924084636-czxo56j2ck1nwutj --- addons/project_planning/project_planning.py | 37 +++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py index e248fe1c050..2044772e6cc 100644 --- a/addons/project_planning/project_planning.py +++ b/addons/project_planning/project_planning.py @@ -25,6 +25,7 @@ import mx.DateTime from osv import fields, osv from tools.translate import _ +import tools class one2many_mod3(fields.one2many): @@ -35,8 +36,9 @@ class one2many_mod3(fields.one2many): for obj in obj.browse(cr, user, ids, context=context): res[obj.id] = [] list_ids = [] - for item in obj.user_id.child_ids: - list_ids.append(item.id) + children = obj.pool.get('report_account_analytic.planning')._child_compute(cr, user, [obj.user_id.id], '', []) + for u_id in children.get(obj.user_id.id, []): + list_ids.append(u_id) list_ids.append(obj.user_id.id) ids2 = obj.pool.get(self._obj).search(cr, user, ['&',(self._fields_id,'=',obj.id),'|',('user_id','in',list_ids),('user_id','=',False)], limit=self._limit) for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'): @@ -49,6 +51,35 @@ class report_account_analytic_planning(osv.osv): _name = "report_account_analytic.planning" _description = "Planning" + def _child_compute(self, cr, uid, ids, name, args, context=None): + if context is None: + context = {} + obj_dept = self.pool.get('hr.department') + obj_user = self.pool.get('res.users') + result = {} + for user_id in ids: + child_ids = [] + cr.execute('SELECT dept.id FROM hr_department AS dept \ + LEFT JOIN hr_employee AS emp ON dept.manager_id = emp.id \ + WHERE emp.id IN \ + (SELECT emp.id FROM hr_employee \ + JOIN resource_resource r ON r.id = emp.resource_id WHERE r.user_id=' + str(user_id) + ') ') + mgnt_dept_ids = [x[0] for x in cr.fetchall()] + ids_dept = obj_dept.search(cr, uid, [('id', 'child_of', mgnt_dept_ids)], context=context) + if ids_dept: + data_dept = obj_dept.read(cr, uid, ids_dept, ['member_ids'], context=context) + childs = map(lambda x: x['member_ids'], data_dept) + childs = tools.flatten(childs) + childs = obj_user.search(cr, uid, [('id', 'in', childs),('active', '=', True)], context=context) + if user_id in childs: + childs.remove(user_id) + child_ids.extend(tools.flatten(childs)) + set = {} + map(set.__setitem__, child_ids, []) + child_ids = set.keys() + result[user_id] = child_ids + return result + def _get_total_planned(self, cr, uid, ids, name, args, context=None): result = {} for plan in self.browse(cr, uid, ids, context): @@ -583,4 +614,4 @@ class res_company(osv.osv): } res_company() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 31c545ac6f31931f57bfb686058fe65f34ac0cda Mon Sep 17 00:00:00 2001 From: "RME(OpenERP)" <> Date: Fri, 24 Sep 2010 15:42:04 +0530 Subject: [PATCH 02/12] [FIX] Account_payment : Demo corrected bzr revid: jvo@tinyerp.com-20100924101204-enl5v3b417t6o4u0 --- addons/account_payment/account_payment_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_payment/account_payment_demo.xml b/addons/account_payment/account_payment_demo.xml index 25fe4a2c55b..37705a05b07 100644 --- a/addons/account_payment/account_payment_demo.xml +++ b/addons/account_payment/account_payment_demo.xml @@ -5,7 +5,7 @@ Reserve Bank 00987654321 - + bank Direct Payment From d7ed28f534b42c198e2595b1cde400d83d23596a Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Fri, 24 Sep 2010 15:43:44 +0530 Subject: [PATCH 03/12] [FIX] POS : Correction in wizard,NEVER ever return None,it can break xmlrpc request. bzr revid: jvo@tinyerp.com-20100924101344-7eu0pcp6y8cql8hw --- addons/point_of_sale/wizard/pos_payment.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 27c04a6dfba..5b6c5f167fb 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -43,7 +43,6 @@ class pos_make_payment(osv.osv_memory): @return: A dictionary which of fields with values. """ res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context) - active_id = context and context.get('active_id',False) if active_id: j_obj = self.pool.get('account.journal') @@ -51,10 +50,7 @@ class pos_make_payment(osv.osv_memory): j_ids = map(lambda x1: x1[0], cr.fetchall()) journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)]) - if journal: - journal = journal[0] - else: - journal = None + journal = journal and journal[0] or False wf_service = netsvc.LocalService("workflow") order_obj=self.pool.get('pos.order') From a525b4733ca5159827d8bedf23748df8d4205d24 Mon Sep 17 00:00:00 2001 From: "RME(OpenERP)" <> Date: Fri, 24 Sep 2010 15:50:33 +0530 Subject: [PATCH 04/12] [FIX] account_payment : Corrections lp bug: https://launchpad.net/bugs/608412 fixed bzr revid: jvo@tinyerp.com-20100924102033-sw8cjvew49bhzcnd --- addons/account_payment/account_payment_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml index 93ba4b85de0..b7cef21f8e0 100644 --- a/addons/account_payment/account_payment_view.xml +++ b/addons/account_payment/account_payment_view.xml @@ -38,7 +38,7 @@ - + payment.mode.tree @@ -203,7 +203,7 @@ - + New Payment Order From 214960b36e9a3bf83ed20f8209c62fbc339d792e Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Fri, 24 Sep 2010 16:09:46 +0530 Subject: [PATCH 05/12] [FIX] pos : pylint test passed. Thanks to buildbot bzr revid: jvo@tinyerp.com-20100924103946-8fj8ksrzyu00kxpi --- addons/point_of_sale/wizard/pos_payment.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 5b6c5f167fb..8330be2772c 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -19,14 +19,10 @@ # ############################################################################## -import netsvc from osv import osv,fields from tools.translate import _ import pos_box_entries import time -from decimal import Decimal -from tools.translate import _ -import pos_receipt class pos_make_payment(osv.osv_memory): _name = 'pos.make.payment' @@ -51,7 +47,6 @@ class pos_make_payment(osv.osv_memory): journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)]) journal = journal and journal[0] or False - wf_service = netsvc.LocalService("workflow") order_obj=self.pool.get('pos.order') order = order_obj.browse(cr, uid, active_id, context) @@ -88,7 +83,7 @@ class pos_make_payment(osv.osv_memory): if active_id: order = self.pool.get('pos.order').browse(cr, uid, active_id) if not order.lines: - raise osv.except_osv('Error!','No order lines defined for this sale ') + raise osv.except_osv(_('Error!'),_('No order lines defined for this sale ')) return True def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): From c3d7dedf07424c5272383e5d1ebeec66e89cd6bf Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Fri, 24 Sep 2010 16:11:24 +0530 Subject: [PATCH 06/12] [REF] hr_timesheet : Better readable messages bzr revid: jvo@tinyerp.com-20100924104124-s0dtgin32s4ezyef --- addons/hr_timesheet/test/hr_timesheet_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml index 811858eb7f2..2f19f75618f 100644 --- a/addons/hr_timesheet/test/hr_timesheet_report.yml +++ b/addons/hr_timesheet/test/hr_timesheet_report.yml @@ -1,5 +1,5 @@ - - In order to test the PDF reports defined on HR Timesheet User Report, we will print a HR Timesheet User Report + In order to test the PDF reports defined on Employee, we will print Timesheet of a User - !python {model: hr.employee}: | import netsvc, tools, os, time @@ -11,7 +11,7 @@ file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data) - - In order to test the PDF reports defined on HR Timesheet Users Report, we will print a HR Timesheet Users Report + In order to test the PDF reports defined on Employee, we will print Timesheet of Users - !python {model: hr.employee}: | import netsvc, tools, os, time From 14d55ddd6dbcb00cf23237a91a9467a89d232e55 Mon Sep 17 00:00:00 2001 From: "SAZ(OpenERP)" <> Date: Fri, 24 Sep 2010 16:13:20 +0530 Subject: [PATCH 07/12] [FIX] hr_timesheet_invoice : Passed the yaml report test bzr revid: jvo@tinyerp.com-20100924104320-2f7dgfk43rp1i6l1 --- .../report/account_analytic_profit.rml | 118 +++++++++--------- .../test/hr_timesheet_invoice_report.yml | 2 +- 2 files changed, 62 insertions(+), 58 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index 3cb4b150395..b6d9f155cab 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -74,24 +74,24 @@ - + - - + + - - - - - + + + + + - - + + @@ -115,8 +115,8 @@ + - @@ -157,12 +157,10 @@ - [[ formatLang (data['form']['date_from'],date=True) -]] + [[ formatLang(data['form']['date_from'],date=True) ]] - [[ formatLang (data['form']['date_to'],date=True) - ]] + [[ formatLang (data['form']['date_to'] ,date=True)]] [[ company.currency_id.name ]] @@ -209,7 +207,7 @@ Totals: - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] @@ -217,47 +215,47 @@ - [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) and round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) and round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] %
[[ repeatIn(user_ids(lines(data['form'])), 'e') ]] - + [[ e.name ]] - [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] + [[ repeatIn(journal_ids(data['form'], [e.id]), 'j') ]] - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) and (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0)]] % + [[reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) and '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0, 2)]] % @@ -298,35 +296,41 @@ -
+ + +
- [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] - - - - [[ l['name'] ]] - - - [[ l['unit_amount'] ]] - - - [[ l['amount_th'] ]] - - - [[ l['amount'] ]] - - - [[ l['cost'] ]] - - - [[ l['profit'] ]] - - - [[ l['eff'] ]] % - - - - + [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] + + + + [[ l['name'] ]] + + + [[ l['unit_amount'] ]] + + + [[ l['amount_th'] ]] + + + [[ l['amount'] ]] + + + [[ l['cost'] ]] + + + [[ l['profit'] ]] + + + [[ l['eff'] ]] % + + + + + + +
+ @@ -334,4 +338,4 @@
- \ No newline at end of file + diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml index ecdd486a65e..32f22e7eb4b 100644 --- a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -3,7 +3,7 @@ - !python {model: account.analytic.line}: | import netsvc, tools, os, time - data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('account.cose_journal_sale'),ref('account.exp'),ref('account.sit')]]], 'date_to': time.strftime('%Y-%m-%d')}} + data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('hr_timesheet.analytic_journal')]]], 'date_to': time.strftime('%Y-%m-%d')}} (data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data) From df261181c191fc4f5d0c27858e2d81655e62daa6 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Fri, 24 Sep 2010 13:30:21 +0200 Subject: [PATCH 08/12] [IMP] base_contact: performance improvement: * rewriten res_partner_job.name_get * res_partner_contact.job_id: store=True bzr revid: olt@tinyerp.com-20100924113021-hf86aenloztuftpe --- addons/base_contact/base_contact.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 1c0525931c7..8e3a4ded7eb 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -61,7 +61,7 @@ class res_partner_contact(osv.osv): 'function': fields.related('job_ids', 'function', type='char', \ string='Main Function'), 'job_id': fields.function(_main_job, method=True, type='many2one',\ - relation='res.partner.job', string='Main Job'), + relation='res.partner.job', string='Main Job', store=True), 'email': fields.char('E-Mail', size=240), 'comment': fields.text('Notes', translate=True), 'photo': fields.binary('Image'), @@ -151,10 +151,15 @@ class res_partner_job(osv.osv): if not len(ids): return [] res = [] - for r in self.browse(cr, uid, ids): - funct = r.function and (", " + r.function) or "" - res.append((r.id, self.pool.get('res.partner.contact').name_get(cr, uid, \ - [r.contact_id.id])[0][1] + funct)) + + jobs = self.browse(cr, uid, ids) + contact_ids = [rec.contact_id.id for rec in jobs] + contact_names = dict(self.pool.get('res.partner.contact').name_get(cr, uid, contact_ids, context=context)) + + for r in jobs: + function_name = r.function + funct = function_name and (", " + function_name) or "" + res.append((r.id, contact_names.get(r.contact_id.id, '') + funct)) return res def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): From 9e50339257b7e3619201e7ad01eb9a5913f0d71c Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Fri, 24 Sep 2010 13:32:32 +0200 Subject: [PATCH 09/12] [FIX] product_margin: tab2space bzr revid: olt@tinyerp.com-20100924113232-vy055qmmzmbtyj98 --- addons/product_margin/product_margin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py index ad6ef680a98..d8d6d7a1702 100644 --- a/addons/product_margin/product_margin.py +++ b/addons/product_margin/product_margin.py @@ -36,11 +36,11 @@ class product_product(osv.osv): date_to = context.get('date_to', time.strftime('%Y-12-31')) invoice_state = context.get('invoice_state', 'open_paid') if 'date_from' in field_names: - res[val.id]['date_from']=date_from + res[val.id]['date_from']=date_from if 'date_to' in field_names: res[val.id]['date_to']=date_to if 'invoice_state' in field_names: - res[val.id]['invoice_state']=invoice_state + res[val.id]['invoice_state']=invoice_state invoice_types = () states = () if invoice_state=='paid': @@ -114,4 +114,4 @@ class product_product(osv.osv): product_product() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From a3900f6daf0aec8500339beb73049845065aeff8 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Fri, 24 Sep 2010 18:12:28 +0530 Subject: [PATCH 10/12] [FIX] auction : Auction Artists Report Corrected bzr revid: ach@tinyerp.com-20100924124228-uoj22v0xiaka4soo --- addons/auction/report/auction_artists.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auction/report/auction_artists.rml b/addons/auction/report/auction_artists.rml index dfe81549245..1a0688825d4 100644 --- a/addons/auction/report/auction_artists.rml +++ b/addons/auction/report/auction_artists.rml @@ -62,7 +62,7 @@ [[o.artist2_id and 'Artist2: '+o.artist2_id.name or False]] - [[o.artist_id2 and 'Biography: '+o.artist_id2.biography or False]] + [[o.artist2_id and 'Biography: '+o.artist2_id.biography or False]] From 0c20778e1c2c2d7fbd4436d2589b2f9d4510c42c Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Fri, 24 Sep 2010 18:14:30 +0530 Subject: [PATCH 11/12] [FIX] document_email : Missing dependency added bzr revid: ach@tinyerp.com-20100924124430-rou6fhggcngzitxp --- addons/document_email/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_email/__openerp__.py b/addons/document_email/__openerp__.py index e341678e009..9ac6dc2fd84 100644 --- a/addons/document_email/__openerp__.py +++ b/addons/document_email/__openerp__.py @@ -24,7 +24,7 @@ { "name" : "Email Integrated Document", "version" : "1.1", - "depends" : ["base", "document", "mail_gateway"], + "depends" : ["base", "document", "fetchmail","mail_gateway"], "author" : "Tiny", "description": """Email Integrated Document * Email based Document submission From 937d8fe3306a1cb31ccbe532531eaadc4ff639d6 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Fri, 24 Sep 2010 15:17:09 +0200 Subject: [PATCH 12/12] [IMP] base_calendar: performance improvement in project.task (progress field) bzr revid: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn --- addons/base_calendar/base_calendar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index facb598427b..5ccfbdb23d8 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1531,8 +1531,12 @@ true, it will allow you to hide the event alarm information without removing it. result = [] if fields and 'date' not in fields: fields.append('date') + + real_ids = [item2 for item1, item2 in select] + event_values = dict([(res['id'], res) for res in super(calendar_event, self).read(cr, uid, real_ids, fields=fields, context=context, load=load)]) + for base_calendar_id, real_id in select: - res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load) + res = event_values[real_id] ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: res['date'] = ls[1]