diff --git a/product/ERP5Form/Form.py b/product/ERP5Form/Form.py index bbcda55f2a4a78b93ce97db59c81df47cbfa28d1..413a77de795801aa5e6f8907ab469fc6b37eb09f 100755 --- a/product/ERP5Form/Form.py +++ b/product/ERP5Form/Form.py @@ -78,7 +78,7 @@ def get_value(self, id, **kw): except AttributeError : LOG('ERP5Form', 0, 'portal_preferences not put in TALES context (not installed?)') - extra_context = REQUEST.get('erp5_extra_context', None) + extra_context = REQUEST.other.get('erp5_extra_context', None) if extra_context: kw.update(extra_context) # This allows to pass some pointer to the local object diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py index 42761c45d7887740eb69b52d9bae3466e1b4ea5c..d31b7d169fdc7070626934ded00c6096971a703c 100755 --- a/product/ERP5Form/ProxyField.py +++ b/product/ERP5Form/ProxyField.py @@ -101,10 +101,10 @@ class ProxyWidget(Widget.Widget): except AttributeError: LOG('ProxyField', WARNING, 'could not get a field from a proxy field %s in %s' % (field.id, form.id)) return '' - extra_context = REQUEST.get('erp5_extra_context', {}) + extra_context = REQUEST.other.get('erp5_extra_context', {}) for k, v in field.get_value('extra_context'): extra_context[k] = v - REQUEST['erp5_extra_context'] = extra_context + REQUEST.other['erp5_extra_context'] = extra_context return proxy_field.widget.render(proxy_field, key, value, REQUEST) def render_view(self, field, value): @@ -119,10 +119,10 @@ class ProxyWidget(Widget.Widget): LOG('ProxyField', WARNING, 'could not get a field from a proxy field %s in %s' % (field.id, form.id)) return '' REQUEST = get_request() - extra_context = REQUEST.get('erp5_extra_context', {}) + extra_context = REQUEST.other.get('erp5_extra_context', {}) for k, v in field.get_value('extra_context'): extra_context[k] = v - REQUEST['erp5_extra_context'] = extra_context + REQUEST.other['erp5_extra_context'] = extra_context return proxy_field.widget.render_view(proxy_field, key, value) @@ -136,6 +136,10 @@ class ProxyValidator(Validator.Validator): form = field.aq_parent proxy_form = getattr(form, field.get_value('form_id')) proxy_field = getattr(proxy_form, field.get_value('field_id')) + extra_context = REQUEST.other.get('erp5_extra_context', {}) + for k, v in field.get_value('extra_context'): + extra_context[k] = v + REQUEST.other['erp5_extra_context'] = extra_context try: result = proxy_field.validator.validate(proxy_field, key, REQUEST) except ValidationError, error: