Sananaz (Open ERP) has proposed merging
lp:~openerp-dev/openobject-client-web/stable-bug-715688-sma into
lp:openobject-client-web/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/stable-bug-715688-sma/+merge/50119
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/stable-bug-715688-sma/+merge/50119
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/stable-bug-715688-sma.
=== modified file 'addons/openerp/utils/tools.py'
--- addons/openerp/utils/tools.py 2011-02-02 09:17:27 +0000
+++ addons/openerp/utils/tools.py 2011-02-17 10:17:22 +0000
@@ -60,9 +60,18 @@
if isinstance(value, list):
for index in range(len(value)):
domain_element = value[index]
- if not (isinstance(domain_element, tuple) and domain_element[2] == 'active_id'):
+ if not (isinstance(domain_element, tuple) and
+ (domain_element[2] == 'active_id' or (isinstance(domain_element[2],list) and 'active_id' in domain_element[2]))):
continue
- value[index] = (domain_element[0], domain_element[1], context['active_id'])
+ right_op = domain_element[2]
+ if isinstance(right_op, list):
+ #Its very much possible that 'active_id' in in list in any sequence
+ #eg. ['active_id'], [1,'active_id'],etc.
+ right_op[right_op.index('active_id')] = context.get('active_id')
+ else:
+ #Replacement of right operator with a direct copy of context['active_id']
+ right_op = context.get('active_id')
+ value[index] = (domain_element[0], domain_element[1], right_op)
elif isinstance(value, dict):
for key, v in value.items():
if v == 'active_id' or v == ['active_id']:
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp