An error occurred fetching the project authors.
  1. 06 Jul, 2024 4 commits
  2. 07 Mar, 2024 1 commit
  3. 21 Feb, 2024 1 commit
  4. 23 Jan, 2024 1 commit
  5. 24 Mar, 2023 3 commits
  6. 06 Feb, 2023 1 commit
  7. 03 Feb, 2023 1 commit
    • Jérome Perrin's avatar
      BusinessTemplate: do not export PythonScripts' Script_magic · 402c1acb
      Jérome Perrin authored
      This is used to trigger recompilation of bytecode, but we don't
      export the byte code so we don't need to export it.
      This also prevent diffs when the Script_magic changed, like it's the
      case with Products.PythonScripts 4.2 , with commit 590125a (Force
      recompilation of scripts., 2017-10-23).
      402c1acb
  8. 30 Jan, 2023 2 commits
  9. 18 Jan, 2023 1 commit
  10. 06 Dec, 2022 1 commit
  11. 21 Nov, 2022 3 commits
  12. 06 Oct, 2022 2 commits
    • Jérome Perrin's avatar
      BusinessTemplate: also sort some path properties · a2bfd4e3
      Jérome Perrin authored
      template_keep_path_list, template_keep_workflow_path_list and
      template_keep_last_workflow_history_only_path_list were not sorted
      for no reason
      a2bfd4e3
    • Jérome Perrin's avatar
      BusinessTemplate: sort properties when saving them · a4a136d7
      Jérome Perrin authored
      The _getOrderedList approach was not ideal, because the properties were
      saved when being displayed, so the typical workflow was:
      
       1. enter the property as non sorted
       2. click save (property is saved as non sorted)
       3. the page displays the property again as sorted
       4. click save again so that the property is saved as sorted
      
      by sorting the properties at save time, step 1 is enough
      
      This change back the accessors to be "standard" accessors, ie. returning
      lists, like every other list accessors, so a few tests and a few scripts
      had to be adjusted for the new API.
      a4a136d7
  13. 30 Sep, 2022 1 commit
  14. 23 Sep, 2022 1 commit
  15. 21 Sep, 2022 1 commit
  16. 18 Aug, 2022 1 commit
    • Jérome Perrin's avatar
      BusinessTemplate: drop useless fixZSQLMethod in SkinTemplateItem.install · 45e45842
      Jérome Perrin authored
      In SkinTemplateItem.install, self._objects contains entries for skin
      folders and for all skins. objectValues method calls was called for skin
      folders (as expected) and also for all skins, which acquire objectValues
      from skin folder and do the work again.
      
      This simplifies this by only running this for skin folders.
      45e45842
  17. 04 May, 2022 5 commits
    • Arnaud Fontaine's avatar
      py3: XMLExportImport: Port to Python3. · 628ab4b4
      Arnaud Fontaine authored
      628ab4b4
    • Arnaud Fontaine's avatar
      py3: BusinessTemplate: Fix reading of BusinessTemplate files. · 719b7c3f
      Arnaud Fontaine authored
      With Python2, properties were all str(). with Python3, we need to distinguish
      binary-like properties from text-like properties.
      
      This should ideally be implemented by checking PropertySheet elementary_type
      (such as `data` for bytes() and `string` or `text` for str()) for each property.
      For now (bootstrap/addERP5Site) though, let's consider all properties in .xml to
      be UTF-8 str() and statically define which is which for non-.xml files.
      719b7c3f
    • Arnaud Fontaine's avatar
      py2/py3: Make Products code compatible with both python2 and python3. · a17bb910
      Arnaud Fontaine authored
      Done through various 2to3 fixers (zope.fixers, modernize, future) and manual
      changes. This is a single commit so that we have a clearer picture of how code
      converted with my2to3 should look like.
      
      Except straightforward @implementer decorator 2to3 fixer, only product/ folder
      was considered as the goal was to be able to create an ERP5Site.
      
      * Use @implementer decorator introduced in zope.interface 3.6.0 (2010):
      
        The implements syntax used under Python 2.X does not work under 3.X, since it
        depends on how metaclasses are implemented and this has changed. Instead it
        now supports a decorator syntax (also under Python 2.X).
      
        Applied thanks to 2to3 `zope.fixers` package.
      
      * Use `six.moves` rather than `future` install_aliases() feature because the
        latter use unicode_literals and "wraps" module aliases so that unicode() are
        returned for text rather than str() (Python2 standard library). This notably
        breaks BusinessTemplate code which uses urllib quote() for filesystem paths...
      
      * No more unbound methods in python3 so use six.get_unbound_function().
      
      * dict.(iteritems,iterkeys,itervalues)() => six.\1(dict) thanks to `dict_six`
        2to3 fixer from `modernize`:
        $ python-modernize -w -f dict_six product/
      
      * Manually make sure that dict.{items,values,keys}() returns a real list when it
        is latter modified rather than a dict_{items,values,keys} (ensure_list()). By
        default, 2to3 blindly does list(dict.{items,values,keys}()) which is not
        acceptable from performances point of view. With my2to3, this will be possible
        to handle such case automatically.
      
      * Replace cStringIO.StringIO() by six.moves.cStringIO() (a module alias for
        cStringIO.StringIO() on py2 and io.StringIO() on py3).
      
      * Use six.text_type which maps to unicode() on py2 and str() on py3. This also
        makes a clearer difference between text and binary strings.
      
      * Replace map()/filter() with lambda function by list comprehension (this has
        the benefit to avoid casting to list for py3 as it returns iterators).
      a17bb910
    • Arnaud Fontaine's avatar
      py3: PythonScript: func_{code,defaults} (Python2 only) => __{code,defaults}__ (Python2/Python3). · 4115e465
      Arnaud Fontaine authored
      Use the latter form that works on both. On non-PythonScript code, this is of
      course not an issue but Python2 PythonScript does not have a __code__ properties
      and requires a patch on Shared.DC.Scripts.Signature (applied by SlapOS recipe)
      so that FuncCode() object is set to not only func_code but also __code__.
      4115e465
    • Arnaud Fontaine's avatar
  18. 21 Apr, 2022 1 commit
    • Arnaud Fontaine's avatar
      zope4: XML Export/Import feature was removed from Zope4. · d303ca49
      Arnaud Fontaine authored
      Only ZEXP Export/Import is possible. These modules (namely OFS.XMLExportImport
      and Shared.DC.xml.*) were heavily monkey-patched anyway and are only used for
      BusinessTemplates.
      
      * ERP5Type/XMLExportImport.py  => ERP5Type/XMLExportImport/__init__.py
      * OFS/XMLExportImport.py       => ERP5Type/XMLExportImport/__init__.py
      * Shared/DC/xml/{xyap,ppml}.py => ERP5Type/XMLExportImport/{xyap,ppml}.py
      d303ca49
  19. 24 Mar, 2022 1 commit
    • Jérome Perrin's avatar
      *: stop using deprecated getWorkflowById · cc60f03a
      Jérome Perrin authored
      This was deprectated because we don't have get*ById for other modules
      and tools, we just use OFS API. This should also be slightly faster
      because one less method call (and one less call to warning)
      cc60f03a
  20. 17 Mar, 2022 1 commit
    • Jérome Perrin's avatar
      component: fix error_message saved in every line of history · 8a335cca
      Jérome Perrin authored
      Because error_message variable was missing in component_validation_workflow,
      once the validation was refused for an error, every subsequent entry
      in workflow history was carrying the same error message.
      
      Adding the missing variable fix this, but it would cause diff every time
      we modify and re-export a component, so we also take care of not exporting
      it in business template, like we already did for other several variables.
      8a335cca
  21. 14 Oct, 2021 1 commit
    • Julien Muchembled's avatar
      fixup! New portal type: External Method · fd4880ce
      Julien Muchembled authored
      This fixes commit ea53f23e:
      
        ERROR Application Couldn't install ERP5Type
        Traceback (most recent call last):
          File "OFS/Application.py", line 691, in install_product
            initmethod(context)
          File "Products/ERP5Type/__init__.py", line 141, in initialize
            initializeProductDocumentRegistry()
          File "Products/ERP5Type/InitGenerator.py", line 62, in initializeProductDocumentRegistry
            importLocalDocument(class_id, class_path=class_path)
          File "Products/ERP5Type/Utils.py", line 994, in importLocalDocument
            module = __import__(module_path, {}, {}, (module_path,))
          File "Products/ERP5/Document/ExternalMethod.py", line 38, in <module>
            class ExternalMethod(XMLObject, ZopeExternalMethod, ExpressionMixin):
        TypeError: Error when calling the metaclass bases
            metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
      
      What happened is that the API of ExpressionMixin changed in commit
      df85ef46 and the backward compatibility
      code (product/ERP5/mixin/expression.py) was broken.
      
      Also fix 'filter' tab on in the catalog.
      See also commit 6ad56d89.
      fd4880ce
  22. 12 Oct, 2021 1 commit
  23. 06 Jul, 2021 1 commit
  24. 11 May, 2021 1 commit
    • Jérome Perrin's avatar
      BusinessTemplate: fix removing and trashing a document and its container · cde13458
      Jérome Perrin authored
      Because we were backing up to trash documents in the wrong order (in the example
      from the test, portal_categories/test_category/removed_container/removed_document
      first and then portal_categories/test_category/removed_container), first the
      document was backed-up and some intermediate trash folders were created to
      keep the hierarchy. Then when backing up the container, there was an error like:
      
          BadRequest: The id "removed_container" is invalid - it is already in use.
      
      Similar error happens when upgrading erp5_configurator_standard, it was failing with:
      
          BadRequest: The id "officejs_sdk_workflow" is invalid - it is already in use.
      
      The fix is to backup in reverse order, to back up first the containers and then
      the document in containers.
      cde13458
  25. 29 Apr, 2021 1 commit
  26. 23 Apr, 2021 1 commit
    • Arnaud Fontaine's avatar
      ERP5Workflow: DC Workflows are now ERP5 objects (!1378). · df85ef46
      Arnaud Fontaine authored
      This also moves all Configurator Workflows in workflow_module to portal_workflow
      (workflow_module was an implementation of Workflows based on ERP5 objects and
      not using DCWorkflow code).
      
      * Workflows are now defined on on portal_workflow._chains_by_type anymore but,
        as everything else, on the Portal Type itself.
      * portal_workflow can contain and work at the same time with legacy and new
        Workflows (ERP5Type/patches/DCWorkflow.py monkey-patching DCWorkflow classes
        to provide the same API).
      * Existing Workflow Scripts should work as they are and the code can be updated
        later on to take advantage of the new API:
        + With legacy implementation Workflow {Scripts,Transitions,Worklists,States}
          were in a Folder ({scripts,transitions,worklists,states} attribute) but
          all of these are now in the Workflow itself and their IDs are prefixed
          (PropertySheet-style), for example `script_`. Legacy attributes are
          provided in new implementation to call the new API.
        + When calling a Workflow Script, `container` was bound to its parent, namely
          WF.scripts (Folder) and a Workflow Script could call another. Now `container`
          is bound to the WF itself and Workflow Scripts are in a Workflow directly.
          New implementation `scripts` attribute handle such use case.
        + Override portal_workflow.__getattr__ so that a Workflow Script can call
          another one without prefix.
      * Worklist are Predicate: Worklist filter objects based on given criterions and
        thus it makes more sense for a Worklist to be a Predicate (albeit a Predicate
        with only Identity Criterion and nothing else).
        + Criterion Properties:
          * state_variable.
          * local_roles (SECURITY_PARAMETER_ID).
          * Any Workflow Variables with for_catalog == 1.
      
      erp5_performance_test:testWorkflowPerformance were ran to compare DCWorkflow
      and ERP5Workflow implementations and it seems to be about 4% slower with the
      new implementation (legacy: 7.547, 7.593, 7.618, 7.59, 7.514 and new: 7.842,
      7.723, 7.902, 7.837, 7.875).
      
      Work done by Wenjie Zheng, Isabelle Vallet, Sebastien Robin and myself.
      df85ef46
  27. 24 Feb, 2021 1 commit