From 8146a3ed43ea7e28add4408688bfd14f300495e1 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 30 Dec 2013 11:40:45 +0100 Subject: [PATCH 1/3] [FIX] note: revert rev 9055 as made impossible to change stage if no rights on other users' relations bzr revid: mat@openerp.com-20131230104045-2h070kuouz4msz1x --- addons/note/note.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index fe917531472..00c67c37191 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -84,10 +84,9 @@ class note_note(osv.osv): return ids and ids[0] or False def _set_stage_per_user(self, cr, uid, id, name, value, args=None, context=None): - if not value: - return False - note = self.browse(cr, SUPERUSER_ID, id, context=context) # do it as SUPERUSER because when creating, followers are not necessariliry set (another function field) - stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid] + note = self.browse(cr, uid, id, context=context) + if not value: return False + stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid ] return self.write(cr, uid, [id], {'stage_ids': [(6, 0, set(stage_ids))]}, context=context) def _get_stage_per_user(self, cr, uid, ids, name, args, context=None): From 0bd968a801dc9bc71280b49d04ecb0752ca851a0 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 31 Dec 2013 15:03:58 +0100 Subject: [PATCH 2/3] [MERGE] [FIX] ir_translation: backport of rev 5018 from trunk rename method load to load_module_terms to avoid name clash with load call from base_import (opw 602531) bzr revid: mat@openerp.com-20131231140358-ldh0snu9zmcs3tpw --- openerp/addons/base/ir/ir_translation.py | 2 +- openerp/addons/base/module/module.py | 2 +- openerp/addons/base/tests/test_base.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index 2ab93e2b11b..c9eaa1c53e4 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -425,7 +425,7 @@ class ir_translation(osv.osv): """ return ir_translation_import_cursor(cr, uid, self, context=context) - def load(self, cr, modules, langs, context=None): + def load_module_terms(self, cr, modules, langs, context=None): context = dict(context or {}) # local copy for module_name in modules: modpath = openerp.modules.get_module_path(module_name) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index e160c49481e..2f31852af8d 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -759,7 +759,7 @@ class module(osv.osv): elif not isinstance(filter_lang, (list, tuple)): filter_lang = [filter_lang] modules = [m.name for m in self.browse(cr, uid, ids) if m.state == 'installed'] - self.pool.get('ir.translation').load(cr, modules, filter_lang, context=context) + self.pool.get('ir.translation').load_module_terms(cr, modules, filter_lang, context=context) def check(self, cr, uid, ids, context=None): for mod in self.browse(cr, uid, ids, context=context): diff --git a/openerp/addons/base/tests/test_base.py b/openerp/addons/base/tests/test_base.py index 1ca66f57943..4cc54aeaf9d 100644 --- a/openerp/addons/base/tests/test_base.py +++ b/openerp/addons/base/tests/test_base.py @@ -311,7 +311,7 @@ class test_translation(common.TransactionCase): self.res_category = self.registry('res.partner.category') self.ir_translation = self.registry('ir.translation') cr, uid = self.cr, self.uid - self.registry('ir.translation').load(cr, ['base'], ['fr_FR']) + self.registry('ir.translation').load_module_terms(cr, ['base'], ['fr_FR']) self.cat_id = self.res_category.create(cr, uid, {'name': 'Customers'}) self.ir_translation.create(cr, uid, {'name': 'res.partner.category,name', 'module':'base', 'value': 'Clients', 'res_id': self.cat_id, 'lang':'fr_FR', 'state':'translated', 'type': 'model'}) From c243854aae85af0769ffd547dd434def2cfb1f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 2 Jan 2014 13:41:43 +0100 Subject: [PATCH 3/3] [FIX] account_anglo_saxon: fixed yml tests using an hardocded year instead of the current year. bzr revid: tde@openerp.com-20140102124143-m1qv8koovjcl8mah --- addons/account_anglo_saxon/test/anglo_saxon.yml | 4 ++-- addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_anglo_saxon/test/anglo_saxon.yml b/addons/account_anglo_saxon/test/anglo_saxon.yml index 6e9ebc0068e..7c3983223b0 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon.yml @@ -115,7 +115,7 @@ - product_id: product.product_product_3 product_qty: 1 price_unit: 10 - date_planned: '2013-08-31' + date_planned: !eval "'%s' % (time.strftime('%Y-%m-%d'))" - I confirm the purchase order. - @@ -235,7 +235,7 @@ As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order. - !python {model: stock.invoice.onshipping}: | - wiz_id = self.create(cr, uid, {'invoice_date': '2013-03-04', 'journal_id': ref('account.sales_journal')}, + wiz_id = self.create(cr, uid, {'journal_id': ref('account.sales_journal')}, {'active_ids': [ref("stock_picking_out001")], "active_model": "stock.picking"}) self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", "search_default_available": 1, "tz": False, "active_model": "stock.picking", diff --git a/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml b/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml index f7d52f4f5a8..93afc48eb11 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml @@ -122,7 +122,7 @@ - product_id: product_fifo_anglo_saxon product_qty: 1 price_unit: 9 - date_planned: '2013-08-31' + date_planned: !eval "'%s' % (time.strftime('%Y-%m-%d'))" taxes_id: [] - I confirm the purchase order. @@ -237,7 +237,7 @@ As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order. - !python {model: stock.invoice.onshipping}: | - wiz_id = self.create(cr, uid, {'invoice_date': '2013-03-04', 'journal_id': ref('account.sales_journal')}, + wiz_id = self.create(cr, uid, {'journal_id': ref('account.sales_journal')}, {'active_ids': [ref("stock_picking_out001_fifo")], "active_model": "stock.picking"}) self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", "search_default_available": 1, "tz": False, "active_model": "stock.picking",