1. 16 Apr, 2020 3 commits
    • 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
    • Arnaud Fontaine's avatar
      erp5_core: Move `ERP5 Form` Portal Type from erp5_hal_json_style as it is used by erp5_core. · 74d022e5
      Arnaud Fontaine authored
      This gets rid of:
        WARNING ERP5Type.dynamic Cannot find a portal type definition for 'ERP5 Form', trying to guess...
      74d022e5
    • Jérome Perrin's avatar
      bff8777e
  2. 15 Apr, 2020 1 commit
  3. 14 Apr, 2020 14 commits
  4. 13 Apr, 2020 6 commits
    • Jérome Perrin's avatar
      testAuthenticationPolicy: install erp5_crm · 468da0e3
      Jérome Perrin authored
      This is a dependency of erp5_credential, it should be installed in the
      test.
      
      This fixes a test failure,
      portal_notification.sendNotification(store_as_event=True) is now an
      error when erp5_crm is not installed.
      468da0e3
    • Jérome Perrin's avatar
      Restricted: bug fixes, support generator and collections module · 12032013
      Jérome Perrin authored
      Add some features to restricted python and fix problems revealed by running Zope's test suites.
      
      # Bug fixes
      
       - Disallow access to old style classes without security declarations. This is not allowed in vanilla zope, but we allowed this accidentally about two years ago. This branch includes some fixes for cases where we accessed not protected classes in a way that should not have been allowed - ERP5 test suite pass, but there might be more cases in code not covered by ERP5 test suite.
       - Fix iterating on `reversed(iterable)` which was unauthorized, maybe since python 2.7
       - Disallow new style classes in container access (iteration, `{}.get` etc). Only classes had this problem, not instances, so this probably has no impact for us, but it allows running AccessControl test suite.
       - Disallow attribute names ending in `__roles__` in class name. This probably does not impact us either, but also for AccessControl tests suite.
      
      
      # New features
      
       - Allow iterating on a generator. It's still not possible to use `yield` statement in restricted python, but iterating is now possible
       - Allow `cStringIO.StringIO("initial value")`, only `cStringIO.StringIO()` was allowed
       - Enable `collections.namedtuple` and add a few tests for other members of `collections` ( not `collections.deque` because we never used it so far )
      
      See merge request !1090
      12032013
    • Jérome Perrin's avatar
      Use gadget editor on portal components in ERP5JS · 24d45f1c
      Jérome Perrin authored
      This uses the new "only ERP5JS" actions to enable components editor in ERP5JS, so that we can edit components on ERP5JS .
      
      This does not change anything in the old UI (erp5_xhml_style), where the editor field will still be used.
      
      See merge request !982
      24d45f1c
    • Jérome Perrin's avatar
      testUpgradeInstanceWithOldDataFs: change connection string in Data.fs · 19b9a486
      Jérome Perrin authored
      This test loads a reference Data.fs, but we don't want to connect to
      the mysql referenced in the mariadb, because it might be used by another
      test node.
      
      Before the beginning of the test, rewrite the connection string to the
      one this test node is using.
      
      This relies on an updated dump produced in nexedi/erp5-bin@8310e4e4
      
      See merge request !1098
      19b9a486
    • Jérome Perrin's avatar
      More Trade Model Path Features · 6c6018f4
      Jérome Perrin authored
      Allow to set more categories (funding and function)
      
      Allow to configure a script to "unset" categories, to address this issue that sometimes we do not want to keep categories from input movements.
      
      ![image](/uploads/d2676cc15d5a85c33dc66df2138d57eb/image.png)
      
      
      See merge request !1082
      6c6018f4
    • Jérome Perrin's avatar
      authentication policy: Fix Credential Recovery creation · 0d078bd1
      Jérome Perrin authored
      `erp5_authentication_policy` can be configured to automatically create `Credential Recovery` for user once login expire.
      
      This was no longer working since we switched to `ERP5 Login`, `Credential Recovery` ticket was created with a relation to `ERP5 Login`, but it should be related to the `Person`.
      
      See merge request !1096
      0d078bd1
  5. 10 Apr, 2020 6 commits
  6. 08 Apr, 2020 10 commits