From f49be0fd1029d989bc7fad70876ec12eb224d866 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 12:32:07 +0530 Subject: [PATCH 1/4] [FIX]audittrail : Fixed the problem of recursion if object contains o2m or m2m field of same object bzr revid: mma@tinyerp.com-20121031070207-079wcftajl19htmo --- addons/audittrail/audittrail.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 9232a696da8..4af516e66f0 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -346,8 +346,13 @@ class audittrail_objects_proxy(object_proxy): x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj)) x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id) - #recursive call on x2m fields that need to be checked too - data.update(self.get_data(cr, SUPERUSER_ID, pool, resource[field], x2m_model, method)) + field_resource_ids = list(set(resource[field])) + if model.model == x2m_model.model: + # we need to remove current resource_id from the many2many to prevent an infinit loop + if resource_id in field_resource_ids: + field_resource_ids.remove(resource_id) + data.update(self.get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method)) + data[(model.id, resource_id)] = {'text':values_text, 'value': values} return data @@ -406,6 +411,10 @@ class audittrail_objects_proxy(object_proxy): x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, []) # We use list(set(...)) to remove duplicates. res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids)) + if model.model == x2m_model.model: + # we need to remove current resource_id from the many2many to prevent an infinit loop + if resource_id in res_ids: + res_ids.remove(resource_id) for res_id in res_ids: lines.update(self.prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list)) # if the value value is different than the old value: record the change From cebb924738f25b209c1f2e5d17da13da7208061c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 12:47:00 +0530 Subject: [PATCH 2/4] [FIX]stock : Set correct condition for color in tree view. bzr revid: mma@tinyerp.com-20121031071700-baqyc8u8ipsk85ts --- addons/stock/stock_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 2321cfe3718..1832ff18755 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -283,10 +283,11 @@ stock.tracking child_ids - + + From d5cc7caf9c0923f5226591dab990cd496b010a2e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 14:11:44 +0530 Subject: [PATCH 3/4] [FIX]account_bank_statement_extensions : Removed use of parent in bank statement line and improved usability bzr revid: mma@tinyerp.com-20121031084144-9qqm7piox5qb7i0k --- .../account_bank_statement_view.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account_bank_statement_extensions/account_bank_statement_view.xml b/addons/account_bank_statement_extensions/account_bank_statement_view.xml index 9164c00373f..62cc74858b4 100644 --- a/addons/account_bank_statement_extensions/account_bank_statement_view.xml +++ b/addons/account_bank_statement_extensions/account_bank_statement_view.xml @@ -72,12 +72,12 @@ - + - - + + @@ -100,8 +100,8 @@ - - + + From e6586d16313be9d7ddbca81c6e2472508682a904 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 14 Nov 2012 18:19:20 +0100 Subject: [PATCH 4/4] [FIX] wording bzr revid: fp@tinyerp.com-20121114171920-pxyq9qp5vcjm79yc --- addons/account/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 409551585fa..3e86c4963b7 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -432,7 +432,7 @@ class account_invoice(osv.osv): if t['state'] in ('draft', 'cancel') and t['internal_number']== False: unlink_ids.append(t['id']) else: - raise osv.except_osv(_('Invalid Action!'), _('You cannot delete an invoice which is open or paid. You should refund it instead.')) + raise osv.except_osv(_('Invalid Action!'), _('You can not delete an invoice which is not cancelled. You should refund it instead.')) osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return True