From 3594dc56da679a12c908bd6e6d81c7fceff52c44 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Fri, 16 May 2014 17:42:20 -0400 Subject: [PATCH 1/5] [FIX] Add context propagation for m2m list view Fix bug https://bugs.launchpad.net/openerp-web/+bug/1279885 : Many2many fields in Tree views will not get translated. If you check the context for a name_get of a m2m field, it is passed as None. Add context propagation to m2m fields in list views. Fix translation issues when viewing a a many2many field in a Tree view. --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 6de354bfcb8..4cf5cc6169b 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1073,7 +1073,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. ids = value; } new instance.web.Model(column.relation) - .call('name_get', [ids]).done(function (names) { + .call('name_get', [ids, this.dataset.context]).done(function (names) { // FIXME: nth horrible hack in this poor listview record.set(column.id + '__display', _(names).pluck(1).join(', ')); From 59c27970b56b60cadd3711db536492ad7c282564 Mon Sep 17 00:00:00 2001 From: kevin wang Date: Mon, 23 Jun 2014 12:48:27 +0200 Subject: [PATCH 2/5] [FIX] orm: allow unicode in inherit views with attribute When extending a view with position='attributes', prevent crash if view contains unicode char Fixes #706 --- openerp/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 1dbac53511f..fc381695fef 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2162,7 +2162,7 @@ class BaseModel(object): node.getparent().remove(node) elif pos == 'attributes': for child in spec.getiterator('attribute'): - attribute = (child.get('name'), child.text and child.text.encode('utf8') or None) + attribute = (child.get('name'), child.text or None) if attribute[1]: node.set(attribute[0], attribute[1]) else: From d0b3e3b8c66e8091766806f3dedc27ab2a264672 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 23 Jun 2014 13:09:36 +0200 Subject: [PATCH 3/5] [IMP] module: when uninstalling a module, do not redirect to a useless screen --- .../addons/base/module/wizard/base_module_upgrade.py | 12 +----------- .../base/module/wizard/base_module_upgrade_view.xml | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/openerp/addons/base/module/wizard/base_module_upgrade.py b/openerp/addons/base/module/wizard/base_module_upgrade.py index 559931fddc1..f827c157bb7 100644 --- a/openerp/addons/base/module/wizard/base_module_upgrade.py +++ b/openerp/addons/base/module/wizard/base_module_upgrade.py @@ -103,17 +103,7 @@ class base_module_upgrade(osv.osv_memory): pooler.restart_pool(cr.dbname, update_module=True) - ir_model_data = self.pool.get('ir.model.data') - __, res_id = ir_model_data.get_object_reference(cr, uid, 'base', 'view_base_module_upgrade_install') - return { - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'base.module.upgrade', - 'views': [(res_id, 'form')], - 'view_id': False, - 'type': 'ir.actions.act_window', - 'target': 'new', - } + return {'type': 'ir.actions.act_window_close'} def config(self, cr, uid, ids, context=None): return self.pool.get('res.config').next(cr, uid, [], context=context) diff --git a/openerp/addons/base/module/wizard/base_module_upgrade_view.xml b/openerp/addons/base/module/wizard/base_module_upgrade_view.xml index 10c023e5148..705ba31b16f 100644 --- a/openerp/addons/base/module/wizard/base_module_upgrade_view.xml +++ b/openerp/addons/base/module/wizard/base_module_upgrade_view.xml @@ -13,7 +13,7 @@
-
From b86e0a4392ed873caf4eb4a4072d3838384b583d Mon Sep 17 00:00:00 2001 From: Jos De Graeve Date: Mon, 23 Jun 2014 18:18:42 +0200 Subject: [PATCH 4/5] [FIX] Partner VAT Intra XML delaration: Vat number format correction The Partner VAT Intra XML delaration needs to have the VAT number in the format without the country code prefix. The current behaviour was to include the country code prefix in the report which causes an SQLException error on uploading the XML file to the Federal goverment's website. While the error is non-descriptive fixing the VAT number format fixes the error. --- addons/l10n_be/wizard/l10n_be_vat_intra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra.py b/addons/l10n_be/wizard/l10n_be_vat_intra.py index ff86a6ba21e..60cd0cb7cb3 100644 --- a/addons/l10n_be/wizard/l10n_be_vat_intra.py +++ b/addons/l10n_be/wizard/l10n_be_vat_intra.py @@ -224,7 +224,7 @@ class partner_vat_intra(osv.osv_memory): data_head = """ - %(company_vat)s + %(vatnum)s %(company_name)s %(street)s %(post_code)s From 7d3453d119a80f484918842682ac5f4299d91e7b Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 24 Jun 2014 12:12:27 +0200 Subject: [PATCH 5/5] [FIX] purchase_requisition: broken procurement wkf If a purchase requisition is created instead of a purchase order for a procurement order, the method make_po should not return the id of this requisition, as methods calling the make_po method expects ids of purchase orders, not purchase requisition ids. Besides, on purchase requisition done or cancel, we set the procurement order accordingly, without the use of the workflow. We consider this as crappy, the proper fix should be the use of a dedicated workflow for purchase requisition, but I cannot be done in stable branches. This aims trunk/master. --- addons/purchase_requisition/purchase_requisition.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index c31f8a69a37..3b8ea1c06c7 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -72,6 +72,8 @@ class purchase_requisition(osv.osv): for purchase_id in purchase.purchase_ids: if str(purchase_id.state) in('draft'): purchase_order_obj.action_cancel(cr,uid,[purchase_id.id]) + procurement_ids = self.pool['procurement.order'].search(cr, uid, [('requisition_id', 'in', ids)], context=context) + self.pool['procurement.order'].write(cr, uid, procurement_ids, {'state': 'cancel'}, context=context) return self.write(cr, uid, ids, {'state': 'cancel'}) def tender_in_progress(self, cr, uid, ids, context=None): @@ -81,6 +83,8 @@ class purchase_requisition(osv.osv): return self.write(cr, uid, ids, {'state': 'draft'}) def tender_done(self, cr, uid, ids, context=None): + procurement_ids = self.pool['procurement.order'].search(cr, uid, [('requisition_id', 'in', ids)], context=context) + self.pool['procurement.order'].write(cr, uid, procurement_ids, {'state': 'done'}, context=context) return self.write(cr, uid, ids, {'state':'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) def _planned_date(self, requisition, delay=0.0): @@ -272,7 +276,7 @@ class procurement_order(osv.osv): for procurement in self.browse(cr, uid, ids, context=context): if procurement.product_id.purchase_requisition: user_company = self.pool['res.users'].browse(cr, uid, uid, context=context).company_id - req = res[procurement.id] = requisition_obj.create(cr, uid, { + req = requisition_obj.create(cr, uid, { 'origin': procurement.origin, 'date_end': procurement.date_planned, 'warehouse_id': self._get_warehouse(procurement, user_company), @@ -288,6 +292,7 @@ class procurement_order(osv.osv): 'state': 'running', 'requisition_id': req }) + res[procurement.id] = 0 else: non_requisition.append(procurement.id)