An error occurred fetching the project authors.
  1. 15 Jul, 2024 1 commit
  2. 11 Jul, 2024 5 commits
  3. 04 May, 2022 1 commit
    • 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
  4. 24 Mar, 2022 1 commit
    • Julien Muchembled's avatar
      ERP55Form: drop a broken proxy field cache · 25ad9ece
      Julien Muchembled authored
      When rendering a proxy field, 3 different fields can come in play:
      1. the field to be rendered
      3. the template field (i.e. not a proxy field) that knows how to render
      2. possibly an intermediate proxy field that contains the value to render
      
      What's difficult when rendering a proxy field is to take the above 3 fields
      into account and this commit does it by creating a temporary field:
      1. 'field' variable in TALES
      2. the value
      3. the code
      
      Before this commit, 1 could be wrong.
      25ad9ece
  5. 10 Aug, 2021 1 commit
  6. 22 Jun, 2021 1 commit
    • Jérome Perrin's avatar
      ERP5Form: fix `cell` in Matrixbox TALES context · 6222335b
      Jérome Perrin authored
      TALESValue always had a strange behavior of setting the request as `cell` when
      rendering a matrixbox in the case where there was no cell at the given
      coordinates, but this code was not used, becase the request was not passed in
      kw. When in 777c5e6c ([ERP5Form] Pass request to fields, 2017-12-29) we
      changed to always pass the request, this changed the behavior. After this
      change when there was no matrix cell, in the TALES context the variable `cell`
      became request.
      
      This restore the original behavior (cell being the cell or None), by changing
      the questionable code that was not used before.
      6222335b
  7. 29 Apr, 2021 1 commit
  8. 29 Jan, 2021 3 commits
    • Jérome Perrin's avatar
      ERP5Form: implement a basic checkConsistency for ProxyField · 459093f3
      Jérome Perrin authored
      For now this only checks that every entries in .tales are also in .values
      so that .has_value works as expected. This also supports repairing the
      structures with fixit argument.
      
      We could check more, because there are other problems with proxy fields
      internal structures:
       - sometimes some keys are in .values / .tales but not in .delegated_list
         this seem to happen after changing the target to a field of a different
         type, with different keys.
       - .delegated_list are not always sorted
      459093f3
    • Jérome Perrin's avatar
      ERP5Form: fix Form.proxifyField when field only has TALES · 4068924a
      Jérome Perrin authored
      The internal data structures are made of two dicts: .values for values and
      .tales for TALES. Formulator expect that these two dicts have keys for all
      properties, because of the implementation of Field.has_value which checks
      for the presence of the key in .values
      
      When making a field with only TALES, this method was setting the value only
      in .tales but the same key needs to be present also in .values, otherwise
      get_value would return False for this key.
      4068924a
    • Jérome Perrin's avatar
      ERP5Form: keep delegated_list sorted in Form.proxifyField · 974f4347
      Jérome Perrin authored
      For same reasons as 5b1c03c8 (sort delegated lists to make proxy field
      representations more stable., 2009-05-18)
      974f4347
  9. 21 Dec, 2020 1 commit
  10. 16 Apr, 2020 1 commit
    • Arnaud Fontaine's avatar
      Portal Type as Classes: ERP5Form: Instances of Documents should never be created directly. · e791d08a
      Arnaud Fontaine authored
      This has been banned since the introduction of Portal Type class. When creating
      a new ERP5Form via addERP5Form/ZMI, its MRO:
        * Before:
          <class 'Products.ERP5Form.Form.ERP5Form'>
          <class 'Products.ERP5Type.Base.Base'>
          ...
          <type 'ExtensionClass.Base'>
        * Now:
          <class 'erp5.portal_type.ERP5 Form'>,
          <class 'Products.ERP5Form.Form.ERP5Form'>,
          <class 'Products.ERP5Type.Base.Base'>,
          ...
          <class 'erp5.accessor_holder.property_sheet.SimpleItem'>
          <class 'erp5.accessor_holder.property_sheet.Folder'>
          <class 'erp5.accessor_holder.property_sheet.Base'>
          <class 'erp5.accessor_holder.property_sheet.CategoryCore'>
          <class 'erp5.accessor_holder.BaseAccessorHolder'>
          <class 'Products.ERP5Type.dynamic.portal_type_class.GetAcquireLocalRolesMixIn'>
          <type 'ExtensionClass.Base'>
      
      Thus it was missing many accessors and was working only by chance (or at least
      unless these accessors were not called until the object was automatically migrated
      by the next call to __setstate__). Namely, as `providesI*` accessors are now in
      BaseAccessorHolder rather than Base due to ZODB Components, this breaks reindexing
      (`AttributeError: providesIPredicate`).
      
      Also, remove hardcoded _getAcquireLocalRoles() now that it is not used as a regular
      class anymore. Set this on the portal type object instead.
      e791d08a
  11. 26 Dec, 2019 1 commit
    • Jérome Perrin's avatar
      ERP5: fix content_type property · 5d5e0c49
      Jérome Perrin authored
      content_type is a bit special, because CMF's PortalFolderBase also have
      a content_type method, so this was confusing ERP5Type dynamic properties
      system. When the property was never set, the default value was the
      method acquired from PortalFolderBase.
      
      Fixes this by defining conten_type class attribute where needed.
      
      This also fixes an old expected failure test, it's now possible to use
      edit(content_type=something) in document without content type property
      set. It works now, but thanks to what seems to be outdated code in
      _valid_property_id from product/ERP5Type/patches/PropertyManager.py,
      because we have stopped setting all properties to None in Base years
      ago. For now, this works, but because of an outdated condition in
      _valid_property_id. We may revisit later in the future.
      5d5e0c49
  12. 16 Sep, 2019 1 commit
  13. 13 Sep, 2019 1 commit
  14. 24 Apr, 2019 1 commit
    • Vincent Pelletier's avatar
      ERP5Type: Allow overriding _getAcquireLocalRoles . · 58d4ab8e
      Vincent Pelletier authored
      Put auto-generated _getAcquireLocalRoles at the end of mro, removing it
      from Base.
      Also, document why it is treated specially here.
      Also, add _getAcquireLocalRoles methods on a few leaf classes whose
      instances fake being portal types, without actually being proper document
      instances. At least, the ones which are detected in unit tests. The
      proper fix would likely rather be to make them proper document classes,
      but this carries data migration concerns which go beyond the scope of
      this regression fix (_getAcquireLocalRoles was not possible to override
      anymore).
      58d4ab8e
  15. 26 Apr, 2018 1 commit
  16. 08 Jan, 2018 2 commits
  17. 25 Oct, 2017 1 commit
  18. 20 May, 2016 1 commit
  19. 11 May, 2016 1 commit
  20. 19 Jan, 2016 1 commit
  21. 12 Jan, 2016 2 commits
  22. 16 Oct, 2014 1 commit
  23. 04 Sep, 2014 1 commit
  24. 08 Aug, 2014 2 commits
  25. 10 Apr, 2014 1 commit
  26. 21 Feb, 2014 1 commit
  27. 06 Feb, 2014 1 commit
  28. 28 Oct, 2013 1 commit
  29. 14 Apr, 2011 1 commit
  30. 07 Apr, 2011 1 commit
  31. 17 Feb, 2011 1 commit