From 29721236fc1346555a15b8eea322986d82cef46c Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:50 +0200 Subject: [PATCH 01/51] document: fix matching of names with non-latin chars At a previous fix, the "res_name == name" condition was added, that didn't, however, consider the case where res_name was unicode and name in utf8. Conflicts: document/nodes.py bzr revid: p_christ@hol.gr-20110118164950-avtkxy8dc4u03fu4 --- addons/document/nodes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 1b7aebcd389..0c4194847c1 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -23,6 +23,7 @@ import pooler from tools.safe_eval import safe_eval +from tools.misc import ustr import errno # import os import time @@ -808,7 +809,7 @@ class node_res_dir(node_class): return res[0] return None - def _child_get(self, cr, name = None, domain=None): + def _child_get(self, cr, name=None, domain=None): """ return virtual children of resource, based on the foreign object. @@ -868,7 +869,7 @@ class node_res_dir(node_class): # Escape the name for characters not supported in filenames res_name = res_name.replace('/','_') # any other weird char? - if name and (res_name != name): + if name and (res_name != ustr(name)): # we have matched _ to any character, but we only meant to match # the special ones. # Eg. 'a_c' will find 'abc', 'a/c', 'a_c', may only @@ -1044,7 +1045,7 @@ class node_res_obj(node_class): if not res_name: continue res_name = res_name.replace('/', '_') - if name and (res_name != name): + if name and (res_name != ustr(name)): continue # TODO Revise klass = directory.get_node_class(directory, dynamic=True, context=ctx) From e9b56eafe2db066332d0065302ca10befa39f381 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:56 +0200 Subject: [PATCH 02/51] docuement: armor the ir.action.report.xml code It was a little careless, better have an assertion there, at least, for the cases we don't cover. Historically, it has been here since commit: efeed12bea5c008ed6 ;) bzr revid: p_christ@hol.gr-20110118164956-vboodk5j4g9eofix --- addons/document/directory_report.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index 6eb18dae850..1665a7abf68 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -42,8 +42,12 @@ class ir_action_report_xml(osv.osv): def _model_search(self, cr, uid, obj, name, args, context=None): if not len(args): return [] + assert len(args) == 1 and args[0][1] == '=', 'expression is not what we expect: %r' % args model_id= args[0][2] if not model_id: + # a deviation from standard behavior: when searching model_id = False + # we return *all* reports, not just ones with empty model. + # One reason is that 'model' is a required field so far return [] model = self.pool.get('ir.model').read(cr, uid, [model_id])[0]['model'] report_id = self.search(cr, uid, [('model','=',model)]) From d9b74f05e44600f85e0d4f823b36135ccc767462 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:59 +0200 Subject: [PATCH 03/51] document_ics: relax domain restriction, it broke PDF reports, too. This whole thing of inheriting the same model for different functionality is a bit problematic. Document ICS is a Frankenstein, too. At least, don't let it break the other document.directory.content entries. bzr revid: p_christ@hol.gr-20110118164959-ctp4l2uj0xvc4v4y --- addons/document_ics/document_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ics/document_view.xml b/addons/document_ics/document_view.xml index 40174612539..39b6908dc76 100644 --- a/addons/document_ics/document_view.xml +++ b/addons/document_ics/document_view.xml @@ -24,7 +24,7 @@ - + From 6572531524011266b5ddc80c25795332073817e3 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:50:15 +0200 Subject: [PATCH 04/51] caldav: Let the ETag of calendar entries be refreshed Skipped earlier, because it is an expensive operation, the write_date of nodes (aka. calendar entries) was cached. That meant that changes from the Gtk client wouldn't be depicted in CalDAV/GroupDAV clients. Now, go for the expensive operation and let them sync. bzr revid: p_christ@hol.gr-20110118165015-vn7avq6zk4t9g2yg --- addons/caldav/caldav_node.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index 70671507b01..5272d0fc1fd 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -494,6 +494,17 @@ class res_node_calendar(nodes.node_class): res = '%d' % (self.calendar_id) return res + def _get_wtag(self, cr): + uid = self.context.uid + context = self.context.context + if self.model and self.res_id: + mod_obj = self.context._dirobj.pool.get(self.model) + pr = mod_obj.perm_read(cr, uid, [self.res_id], context=context, details=False)[0] + self.write_date = pr.get('write_date') or pr.get('create_date') + + # Super will use self.write_date, so we should be fine. + return super(res_node_calendar, self)._get_wtag(cr) + def rm(self, cr): uid = self.context.uid res = False From 9b0993e74c77282bf0dbe6726421dc1e5450b7d7 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:50:21 +0200 Subject: [PATCH 05/51] webdav: ';' in name not handled correctly [Bug 704444] Reported by: Dr. Ferdinand Gassauer Locations that contain a semicolon are split by the urlparse.urlparse(), thus setting their 'path' and 'params' return fields (rather than just the 'path'). In our syntax, there is no params, so the part after the semicolon needs to be appended back to the patch. bzr revid: p_christ@hol.gr-20110118165021-4knt76njdqnt1eln --- addons/document_webdav/dav_fs.py | 4 ++++ addons/document_webdav/webdav.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index 22f50cb8e9a..8c606e4cca0 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -414,6 +414,8 @@ class openerp_dav_handler(dav_interface): # relative part, because ul is relative, anyway uparts=urlparse.urlparse(turi) turi=uparts[2] + if uparts[3]: + turi += ';' + uparts[3] if turi.startswith(ul): result.append( turi[len(self.parent.davpath):]) else: @@ -440,6 +442,8 @@ class openerp_dav_handler(dav_interface): def uri2local(self, uri): uparts=urlparse.urlparse(uri) reluri=uparts[2] + if uparts[3]: + reluri += ';'+uparts[3] if reluri and reluri[-1]=="/": reluri=reluri[:-1] return reluri diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 1b60ade698f..3a68fb04fed 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -167,6 +167,8 @@ def mk_prop_response(self, uri, good_props, bad_props, doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -246,6 +248,8 @@ def mk_propname_response(self,uri,propnames,doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -303,6 +307,8 @@ def mk_lock_response(self, uri, props): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') davpath = self.parent.get_davpath() From 46eeb2d31fd6f566b1aa80089b71770ca12f4d1d Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 31 Jan 2011 10:55:59 +0530 Subject: [PATCH 06/51] [FIX] crm, hr_payroll: Corrected date problem in ymls. bzr revid: uco@tinyerp.com-20110131052559-pnmgnhkcop52186r --- addons/crm/test/test_crm_meeting.yml | 2 +- addons/crm/test/test_crm_opportunity.yml | 4 ++-- addons/crm/test/test_crm_phonecall.yml | 6 +++--- addons/hr_payroll/test/payroll_register.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index d7c8a4691d6..d143de3d24a 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -7,7 +7,7 @@ !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: categ_id: crm.categ_meet2 date: !eval time.strftime('%Y-%m-%d 16:04:00') - date_deadline: !eval "'%s-%s-%s 00:04:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date_deadline: !eval "'%s-%s-%d 00:04:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" duration: 8.0 email_from: info@balmerinc.be location: Ahmedabad diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 3a25db66381..a31c7af8fb2 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -51,7 +51,7 @@ I click on "schedule call" button and select planned date for the call. - !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: - date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" name: 'ABC FUEL CO 829264 - 10002 units' section_id: crm.section_sales_department user_id: base.user_demo @@ -72,7 +72,7 @@ I can see phonecall record after click on "Schedule call" wizard. - !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: - date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 11:15:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" duration: 3.0 name: 'ABC FUEL CO 829264 - 10002 units' partner_address_id: base.res_partner_address_1 diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 98020d345e6..a5726da8cd7 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -64,8 +64,8 @@ - !record {model: crm.meeting, id: crm_meeting_interviewcall0}: alarm_id: base_calendar.alarm3 - date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" - date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" + date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" duration: 8.0 email_from: info@balmerinc.be name: Interview call @@ -81,7 +81,7 @@ phonecall. - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" name: Interview call section_id: crm.section_sales_department user_id: base.user_root diff --git a/addons/hr_payroll/test/payroll_register.yml b/addons/hr_payroll/test/payroll_register.yml index 4a16dafe6ed..ce2284c8cc2 100644 --- a/addons/hr_payroll/test/payroll_register.yml +++ b/addons/hr_payroll/test/payroll_register.yml @@ -26,7 +26,7 @@ I create a payroll register record. - !record {model: hr.payroll.register, id: hr_payroll_register_payroll0}: - date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" line_ids: - employee_id: hr_payroll.hr_employee_keith0 name: payroll1 From 7c4d853ea2f19935be7877d80904629332e83fdc Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 31 Jan 2011 11:13:23 +0530 Subject: [PATCH 07/51] [FIX] lunch, hr_recruitment: Corrected date problem in ymls. bzr revid: uco@tinyerp.com-20110131054323-jw446osaptu8zteq --- addons/hr_recruitment/test/test_hr_recruitment.yml | 4 ++-- addons/lunch/test/test_lunch.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_recruitment/test/test_hr_recruitment.yml b/addons/hr_recruitment/test/test_hr_recruitment.yml index ae322475a62..56feac0d199 100644 --- a/addons/hr_recruitment/test/test_hr_recruitment.yml +++ b/addons/hr_recruitment/test/test_hr_recruitment.yml @@ -84,8 +84,8 @@ !record {model: crm.meeting, id: crm_meeting_fresher0}: alarm_id: base_calendar.alarm1 count: 0.0 - date: !eval "'%s-%s-%s 00:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" - date_deadline: !eval "'%s-%s-%s 08:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day+1)" + date: !eval "'%s-%s-%s 00:00:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" + date_deadline: !eval "'%s-%s-%s 08:00:00' %(datetime.now().year, (datetime.now()+timedelta(1)).month, (datetime.now()+timedelta(1)).day)" day: 0.0 duration: 8.0 name: Fresher diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index 0b5e756f8b3..2158685ea21 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -66,7 +66,7 @@ I create a new lunch order "LU002" for the "Club1" product, at another date. - !record {model: lunch.order, id: lunch_order_1}: - date: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+2)" + date: !eval "'%s-%s-%s' %(datetime.now().year, (datetime.now()+timedelta(2)).month, (datetime.now()+timedelta(2)).day)" product: 'lunch_product_club1' price: 2.75 user_id: base.user_root From ed8b73b1b6d8a35daa02f098b51bf39d1f0dccc8 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 1 Feb 2011 11:02:43 +0530 Subject: [PATCH 08/51] [IMP]: usability Improvement bzr revid: atp@tinyerp.com-20110201053243-m4es7u9p19sef7py --- addons/crm/wizard/crm_add_note_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/wizard/crm_add_note_view.xml b/addons/crm/wizard/crm_add_note_view.xml index f218a4252c1..4da4a569733 100644 --- a/addons/crm/wizard/crm_add_note_view.xml +++ b/addons/crm/wizard/crm_add_note_view.xml @@ -30,7 +30,7 @@ -