Commit 0d75c476 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: download OOoDocument when accessed by reference

Same behaviour than File/Image
parent e362d623
return context.File_viewAsWeb(REQUEST=REQUEST, response=response, mapping_dict=mapping_dict)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None, mapping_dict=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_viewAsWeb</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
  • @romain is it possible that this causes the test failures from coding style it started to fail around this commit with error like this:

    ======================================================================
    ERROR: test_deadProxyFields (CodingStyleTest.CodingStyleTest erp5_corporate_identity_test)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart24/t/eci/soft/e2a3956dee8fbe81b7778768f2abf286/parts/erp5/product/ERP5/tests/testXHTML.py", line 109, in test_deadProxyFields
        template_field = field.getTemplateField(cache=False)
      File "/srv/slapgrid/slappart24/t/eci/soft/e2a3956dee8fbe81b7778768f2abf286/parts/erp5/product/ERP5Form/ProxyField.py", line 437, in getTemplateField
        proxy_field = proxy_form._getOb(field_id, None)
    AttributeError: _getOb

    I see we have a proxy field using OOoDocument_viewAsWeb as form_id https://lab.nexedi.com/nexedi/erp5/-/blob/a61abaafd25785754f76bbc3541b003d9a11cc64/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms_web/PDF_viewAsWeb/download_pdf.xml#L90

    The fix seems to be to change the proxy field, it's not really legal to make a proxy field to another field in a "normal" form, we are supposed to use proxy field library forms as target

    /cc @georgios.dagkakis

  • I agree with the origin of the problem.

    But, I went in another direction to try fixing it: !1968 (merged)

  • mentioned in merge request !1968 (merged)

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment