From 6629729f2de9c411a8fc4e9be10be0c0e4cb4c07 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 4 Dec 2014 11:34:42 +0100 Subject: [PATCH 1/3] [FIX] account_analytic_analysis: tree fields access rights Add invoicing related fields on anlytic account tree view for the invoicing group only Otherwise, when a user not having the invoicing access rights displays the analytic account list, he gets an access right error. opw-619485 --- .../account_analytic_analysis/account_analytic_analysis_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index 125707192bf..3d7a2d3a9fb 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -168,6 +168,7 @@ account.analytic.account.list.contract account.analytic.account + From aa10972d13eeb2414bcfb0a0c402ef49573e1756 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Tue, 18 Nov 2014 09:33:47 -0500 Subject: [PATCH 2/3] Raise error on read of a browse object with bad id Check if id is valid by searching record columns when a key error is raised If the record has the column, the key error is actually an error on a missing or inaccessible id. Signed-off-by: Sandy Carter Closes #3658 --- openerp/osv/orm.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index dc949db16ad..7f064a401a8 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -501,7 +501,17 @@ class browse_record(object): def __getattr__(self, name): try: return self[name] - except KeyError, e: + except KeyError as e: + if name in self._all_columns: + raise ValueError( + 'Cannot fetch field "%(field)s" for "%(model)s" record ' + 'with ID %(id)s, that record does not exist or has been ' + 'deleted' % { + 'field': name, + 'model': self._model._name, + 'id': self._id, + } + ) raise AttributeError(e) def __contains__(self, name): From 284ca73b1c6fd70352a2829f5b2cea92647348e2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 8 Dec 2014 14:46:11 +0100 Subject: [PATCH 3/3] [FIX] pad: etherpad limits pad id length to 50 See https://github.com/ether/etherpad-lite/issues/1116 --- addons/pad/pad.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/pad/pad.py b/addons/pad/pad.py index b79d2f01ca8..0eb92808053 100644 --- a/addons/pad/pad.py +++ b/addons/pad/pad.py @@ -37,7 +37,9 @@ class pad_common(osv.osv_memory): s = string.ascii_uppercase + string.digits salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)]) #path - path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt) + # etherpad hardcodes pad id length limit to 50 + path = '-%s-%s' % (self._name, salt) + path = '%s%s' % (cr.dbname.replace('_','-')[0:50 - len(path)], path) # contruct the url url = '%s/p/%s' % (pad["server"], path)