From 0a80db1ee3a935b97800156ae75d419ab3e58069 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 1 May 2009 12:51:09 +0530 Subject: [PATCH 1/7] [FIX] Bug 367471 : Timesheet lines notification on chaning saved record's date bzr revid: jvo@tinyerp.com-20090501072109-nsk4y8dyrzzn4udi --- addons/hr_timesheet/hr_timesheet.py | 10 +++++++++- addons/hr_timesheet/hr_timesheet_view.xml | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index a74efd53cdd..70d4a80c501 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -111,7 +111,15 @@ class hr_analytic_timesheet(osv.osv): } def on_change_account_id(self, cr, uid, ids, account_id): return {'value':{}} - + + def on_change_date(self, cr, uid, ids, date): + if ids: + new_date = self.read(cr,uid,ids[0],['date'])['date'] + if date != new_date: + warning = {'title':'User Alert!','message':'Changing the date will let this entry appear in the timesheet of the new date.'} + return {'value':{},'warning':warning} + return {'value':{}} + def create(self, cr, uid, vals, context={}): try: res = super(hr_analytic_timesheet, self).create(cr, uid, vals, context) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index e44a50ace19..c9f7214ecca 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -8,7 +8,7 @@ - + @@ -25,9 +25,9 @@ form
- + - + From 25177a0fe57f7da57b6af23f3215ddc78b4c091d Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 1 May 2009 15:26:06 +0530 Subject: [PATCH 2/7] [FIX] Bug 368698 : Warning resolved(ref:.GPA) bzr revid: jvo@tinyerp.com-20090501095606-te74htk5inczcmit --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 1aa4673ce8a..17eabbc2f16 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -369,7 +369,7 @@ class hr_timesheet_line(osv.osv): elif (x[2] is False) and (x[1] == '<>' or x[1] == '!='): qu1.append('(s.id IS NOT NULL)') else: - qu1.append('(s.id %s %s)' % (x[1], '%d')) + qu1.append('(s.id %s %s)' % (x[1], '%s')) qu2.append(x[2]) elif x[1] == 'in': if len(x[2]) > 0: @@ -486,7 +486,7 @@ class hr_attendance(osv.osv): elif (x[2] is False) and (x[1] == '<>' or x[1] == '!='): qu1.append('(s.id IS NOT NULL)') else: - qu1.append('(s.id %s %s)' % (x[1], '%d')) + qu1.append('(s.id %s %s)' % (x[1], '%s')) qu2.append(x[2]) elif x[1] == 'in': if len(x[2]) > 0: From c07b4784127f050669eb3327008617d39f7ede6a Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 1 May 2009 17:42:38 +0530 Subject: [PATCH 3/7] [FIX] Bug 362727 : Report creator now lists only related models,filter wizard bugfixes bzr revid: jvo@tinyerp.com-20090501121238-0pyzyo6avpoj7jfm --- .../base_report_creator.py | 30 +++++++++++++++++-- .../base_report_creator_view.xml | 2 +- .../wizard/wiz_set_filter_fields.py | 15 +++++----- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index 12e95186217..93f2ff837c0 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -47,6 +47,32 @@ from tools.translate import _ # return super(ir_model_fields, self).search(cr, uid, args, offset, limit, order, context) #ir_model_fields() +class ir_model(osv.osv): + _inherit = 'ir.model' + + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + res_model_ids = super(ir_model,self).search(cr, uid, args, offset, limit, order, context=context, count=count) + try: + if 'model_ids' in context and context['model_ids'][0][2]: + model_ids = context['model_ids'][0][2] + result = [] + name_list = [] + if model_ids: + obj = self.read(cr, uid, model_ids,['model']) + for name in obj: + name_list.append(name['model']) + cr.execute("SELECT model_id, relation FROM ir_model_fields WHERE relation in (%s)" % (','.join(map(lambda x: "'"+str(x)+"'",name_list)))) + + for r in cr.fetchall(): + result.append(r[0]) + return result + return res_model_ids + + except Exception,e: + pass + +ir_model() + class report_creator(osv.osv): _name = "base_report_creator.report" _description = "Report" @@ -354,8 +380,8 @@ class report_creator(osv.osv): _constraints = [ (_function_field, 'You can not display field which are not stored in Database.', ['field_ids']), - (_aggregation_error, 'You can apply agregate function to the non calculated field.', ['field_ids']), - (_calander_view_error, "You must have to give calander view's color,start date and delay.", ['field_ids']), + (_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']), + (_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']), ] report_creator() diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml index 494e98d7d02..7ae858012ed 100644 --- a/addons/base_report_creator/base_report_creator_view.xml +++ b/addons/base_report_creator/base_report_creator_view.xml @@ -38,7 +38,7 @@ - +