From 90651e2d10481f5c6877afdc24d33b697b973513 Mon Sep 17 00:00:00 2001
From: Tomas Peterka <tomas.peterka@nexedi.com>
Date: Tue, 29 Aug 2017 14:33:26 +0200
Subject: [PATCH] [ERP5Form] Field.render passes extra arguments so
 user-defined fields can have richer rendering

---
 product/Formulator/Field.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/product/Formulator/Field.py b/product/Formulator/Field.py
index c279750b86..546ca4a271 100644
--- a/product/Formulator/Field.py
+++ b/product/Formulator/Field.py
@@ -194,7 +194,7 @@ class Field:
                 return "Unknown error: %s" % name
 
     security.declarePrivate('_render_helper')
-    def _render_helper(self, key, value, REQUEST, render_prefix=None, editable=None):
+    def _render_helper(self, key, value, REQUEST, render_prefix=None, editable=None, **kw):
       value = self._get_default(key, value, REQUEST)
       __traceback_info__ = ('key=%s value=%r' % (key, value))
       if self.get_value('hidden', REQUEST=REQUEST):
@@ -204,10 +204,10 @@ class Field:
           editable = self.get_value('editable', REQUEST=REQUEST)
         if not editable:
           return self.widget.render_view(self, value, REQUEST=REQUEST,
-                                         render_prefix=render_prefix)
+                                         render_prefix=render_prefix, **kw)
         else:
           return self.widget.render(self, key, value, REQUEST,
-                                    render_prefix=render_prefix)
+                                    render_prefix=render_prefix, **kw)
 
     security.declarePrivate('_render_odt_helper')
     def _render_odt_helper(self, key, value, as_string, ooo_builder,
@@ -261,7 +261,7 @@ class Field:
       return REQUEST.form[key]
 
     security.declareProtected('View', 'render')
-    def render(self, value=None, REQUEST=None, key=None, render_prefix=None, key_prefix=None, editable=None):
+    def render(self, value=None, REQUEST=None, key=None, render_prefix=None, key_prefix=None, editable=None, **kw):
       """Render the field widget.
       value -- the value the field should have (for instance
                 from validation).
@@ -279,6 +279,7 @@ class Field:
         REQUEST,
         render_prefix=render_prefix,
         editable=editable,
+        **kw
       )
 
     security.declareProtected('View', 'render_view')
-- 
2.30.9