From 20034f37a4bd7b61a339dc779528a8f457c90cba Mon Sep 17 00:00:00 2001 From: "Naresh (OpenERP)" Date: Wed, 8 Jun 2011 14:10:20 +0530 Subject: [PATCH] [FIX]:The referece field will only return FALSE if any one its part is left blank..also avoid passing context 'NONE' to client because xmlrpc will not allow None values lp bug: https://launchpad.net/bugs/793682 fixed bzr revid: nch@tinyerp.com-20110608084020-46yom48x3nsk28eh --- openerp/addons/base/ir/ir_actions.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 290eeb36509..b86900cc60d 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -162,13 +162,13 @@ class act_window(osv.osv): def _invalid_model_msg(self, cr, uid, ids, context=None): return _('Invalid model name in the action definition.') - + _constraints = [ (_check_model, _invalid_model_msg, ['res_model','src_model']) ] def _views_get_fnc(self, cr, uid, ids, name, arg, context=None): - """Returns an ordered list of the specific view modes that should be + """Returns an ordered list of the specific view modes that should be enabled when displaying the result of this action, along with the ID of the specific view to use for each mode, if any were required. @@ -208,7 +208,7 @@ class act_window(osv.osv): if act.search_view_id: search_view_id = act.search_view_id.id else: - res_view = self.pool.get('ir.ui.view').search(cr, uid, + res_view = self.pool.get('ir.ui.view').search(cr, uid, [('model','=',act.res_model),('type','=','search'), ('inherit_id','=',False)], context=context) if res_view: @@ -452,7 +452,9 @@ class actions_server(osv.osv): return [(r['model'], r['name']) for r in res] + [('','')] def change_object(self, cr, uid, ids, copy_object, state, context=None): - if state == 'object_copy': + if state == 'object_copy' and copy_object: + if context is None: + context = {} model_pool = self.pool.get('ir.model') model = copy_object.split(',')[0] mid = model_pool.search(cr, uid, [('model','=',model)])