From f7c7f0bb7fa91b6f4ca9c57df77589ed5b6accc6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 3 Sep 2009 14:50:00 +0200 Subject: [PATCH 1/6] [FIX] document: do not try to index binary documents bzr revid: chs@taupe-20090903125000-p2yhb7gh7emlr6ip --- addons/document/content_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/content_index.py b/addons/document/content_index.py index d5878594644..6540b87b5ff 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -63,8 +63,8 @@ def content_index(content, filename=None, content_type=None): s.close() elif ext in ('.txt','.py','.patch','.html','.csv','.xml'): result = content - else: - result = content + #else: + # result = content return result # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From fafe3c939a67fb7312fd5c35196fdfd236065406 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 3 Sep 2009 15:06:49 +0200 Subject: [PATCH 2/6] [FIX] base_module_record: avoid duplications bzr revid: chs@taupe-20090903130649-d7f3hg9lr7shg94l --- addons/base_module_record/base_module_record.py | 13 +++++-------- .../wizard/base_module_record_objects.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index c5ce478b6fb..d9cf8368528 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -145,14 +145,11 @@ class base_module_record(osv.osv): newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) if not newid: newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) -# if valitem[0]==0: -# newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2]) -# else: -# newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1]) + self.ids[(fields[key]['relation'], valitem[1])] = newid + childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid) noupdate = noupdate or update record_list += childrecord - self.ids[(fields[key]['relation'],newid)] = newid else: pass elif fields[key]['type'] in ('many2many',): @@ -161,7 +158,7 @@ class base_module_record(osv.osv): if valitem[0]==6: for id2 in valitem[2]: id,update = self._get_id(cr, uid, fields[key]['relation'], id2) - self.ids[(fields[key]['relation'],id)] = id + self.ids[(fields[key]['relation'],id2)] = id noupdate = noupdate or update res.append(id) field = doc.createElement('field') @@ -265,7 +262,7 @@ class base_module_record(osv.osv): elif rec[4]=='create': id = self._create_id(cr, uid, rec[3],rec[5]) record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[5], id) - self.ids[(rec[3],result)] = id + self.ids[(rec[3], result)] = id record_list += record elif rec[4]=='copy': @@ -276,7 +273,7 @@ class base_module_record(osv.osv): self.recording_data=rec_data id = self._create_id(cr, uid, rec[3],rec[6]) record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[6], id) - self.ids[(rec[3],result)] = id + self.ids[(rec[3], result)] = id record_list += record return record_list,noupdate diff --git a/addons/base_module_record/wizard/base_module_record_objects.py b/addons/base_module_record/wizard/base_module_record_objects.py index b589485327f..ff7b79a030f 100644 --- a/addons/base_module_record/wizard/base_module_record_objects.py +++ b/addons/base_module_record/wizard/base_module_record_objects.py @@ -89,7 +89,7 @@ def _record_objects(self, cr, uid, data, context): search_ids=obj_pool.search(cr,uid,search_condition) for s_id in search_ids: args=(cr.dbname,uid,user,obj_name,'copy',s_id,{},context) - mod.recording_data.append(('query',args, {},s_id)) + mod.recording_data.append(('query',args, {}, s_id)) return {} def inter_call(self,cr,uid,data,context): From 322a34009dc317eec8ff81e2e49ccbb57ac018f3 Mon Sep 17 00:00:00 2001 From: "Niels(Rrd15)" <> Date: Fri, 11 Sep 2009 14:47:12 +0530 Subject: [PATCH 3/6] [FIX] Project : task work behavior towards task hours corrected lp bug: https://launchpad.net/bugs/427388 fixed bzr revid: jvo@tinyerp.com-20090911091712-w5oi9z2wnjvuvb2j --- addons/project/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 72a7958e921..cc885eb5d95 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -433,8 +433,9 @@ class project_work(osv.osv): def write(self, cr, uid, ids,vals,context={}): if 'hours' in vals and (not vals['hours']): vals['hours'] = 0.00 - for work in self.browse(cr, uid, ids, context): - cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) + if 'hours' in vals: + for work in self.browse(cr, uid, ids, context): + cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id)) return super(project_work,self).write(cr, uid, ids, vals, context) def unlink(self, cr, uid, ids, *args, **kwargs): From d536112575d7f71320089485f19dd0a8c6f3323e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 19:42:19 +0530 Subject: [PATCH 4/6] [FIX] Project : Taks hours computed accurately. bzr revid: jvo@tinyerp.com-20090911141219-2i0wlal54ciqx975 --- addons/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project.py b/addons/project/project.py index cc885eb5d95..aaf16082792 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -280,7 +280,7 @@ class task(osv.osv): 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'), 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."), - 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), + 'remaining_hours': fields.float('Remaining Hours', digits=(16,4), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."), 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True, help="Computed as: Time Spent / Total Time."), 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as: Total Time - Estimated Time. It gives the difference of the time estimated by the project manager and the real time to close the task."), From c6e801a2d1414460f99e910a42767d9fd0db99bb Mon Sep 17 00:00:00 2001 From: "ACH(OpenERP)" <> Date: Fri, 11 Sep 2009 19:52:57 +0530 Subject: [PATCH 5/6] [FIX] hr_timesheet_sheet : Rounding value problem in float_time widget lp bug: https://launchpad.net/bugs/424177 fixed bzr revid: jvo@tinyerp.com-20090911142257-s8prbnz3lgymqsvu --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 9d8bdb1ba64..3fbf615ad18 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -576,7 +576,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv): sheet_id, total_timesheet, total_attendance, - (total_attendance - total_timesheet) AS total_difference + round(cast((total_attendance - total_timesheet) as Numeric),2) AS total_difference FROM (( SELECT From a4fbd2e0ffe239d3413c2aee9203565e06bbf7c8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 11 Sep 2009 21:01:07 +0530 Subject: [PATCH 6/6] [FIX] Account : Making account.invoice.tax field language-depenant from account.tax lp bug: https://launchpad.net/bugs/407293 fixed bzr revid: jvo@tinyerp.com-20090911153107-r8dw1nf94xuyllmy --- addons/account/invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index ad38ff87e68..be9b4f63246 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -429,8 +429,9 @@ class account_invoice(osv.osv): ait_obj = self.pool.get('account.invoice.tax') for id in ids: cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) - partner = self.browse(cr, uid, id).partner_id - context.update({'lang': partner.lang}) + partner = self.browse(cr, uid, id,context=context).partner_id + if partner.lang: + context.update({'lang': partner.lang}) for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) # Update the stored value (fields.function), so we write to trigger recompute