1. 13 Aug, 2020 3 commits
    • Jérome Perrin's avatar
      ERP5Type: compatibility for document classes · b994fb06
      Jérome Perrin authored
      TODO: update message. old message below (scope and implementation changed since we cover
      original Products.*.Document and don't do newTempX )
      
      ---
      
      make Products.ERP5Type.Document a dynamic module
      
      Historically all document classes from Products/*/Document/*.py and from
      $INSTANCE_HOME/Document/*.py were dynamically loaded in
      Products.ERP5Type.Document namespace and objects in ZODB were instances
      of Products.ERP5Type.Document.*.* classes. This allowed moving the
      python code from one product to another without having to wory about
      persistent references in ZODB.
      This was done in Products.ERP5Type.Utils.importLocalDocument which was
      used for Products/*/Document/*py and $INSTANCE_HOME/Document/*.py but
      that was never the case for document components - they are loaded on demand.
      
      When "portal types as classes" have been introduced, we used a new
      indirect erp5.portal_type namespace, for similar reasons as the
      Products.ERP5Type.Document namespace. The approach to migrate existing
      documents was to hook the loading from ZODB ( Base.__setstate__ , monkey
      patched from Products/ERP5Type/dynamic/persistent_migration.py ) to
      replace the class from the old Products.ERP5Type.Document.* by its
      corresponding erp5.portal_type.* class.
      
      This was working fine to migrate documents whose classes were defined in
      Products/*/Document/*.py, but now that these classes have been moved to
      document components, this does not work anymore, because unlike when
      loading a document class from Products/*/Document/X.py we don't create
      the corresponding Products.ERP5Type.Document.X module when loading from
      X component. As a result, existing documents of class
      Products.ERP5Type.Document.X.X which did not get a chance to be migrated
      before X was moved to component were now broken. In the observed case,
      there was several Address, Telephone or Email created ~10 years ago.
      
      These changes address this issue by making Products.ERP5Type.Document a
      dynamic module, ie. changing the previous beaviour of copying all
      document classes to Products.ERP5Type.Document by introducing a module
      that will dynamically lookup the document classes on demand, first from
      erp5.component.document modules, then falling back to the legacy
      document classes registry (populated at startup from
      Products/*/Document/*.py and $INSTANCE_HOME/Document/*.py)
      
      A side effect of this is that newTempX constructors are now created from
      document components as well (but they are still deprecated because their
      behavior is really strange: when you call newTempX - X is the name of a
      document class, which has a portal_type attribute and newTempX create an
      instance of the portal type defined on that class, but the portal type
      might be referencing anothing class)
      b994fb06
    • Jérome Perrin's avatar
      testBusinessTemplate: integration test of legacy document classes · 208f34eb
      Jérome Perrin authored
      Test importing a business templates with classes from Products.ERP5Type.Document
      208f34eb
    • Jérome Perrin's avatar
      testDynamicClassGeneration: fix test class hierarchy · b18e6a76
      Jérome Perrin authored
      because TestZodbDocumentComponent contains test specific to Document
      Component, tests for other component should not inherit from it, because
      tests that apply for Document Component only does not apply for other
      components.
      
      The correct base class containing tests that apply to any type of
      component is _TestZodbComponent
      
      TestZodbDocumentComponentReload was another case, this test tests some
      special cases of document edition/reload, it does not need to extend
      TestZodbDocumentComponent, otherwise it will run again all tests from
      TestZodbDocumentComponent.
      b18e6a76
  2. 12 Aug, 2020 7 commits
    • Roque's avatar
      Erp5 officejs skip bootloader test · 6b12e2b2
      Roque authored
      See merge request !1239
      6b12e2b2
    • Roque's avatar
      37f1c0af
    • Jérome Perrin's avatar
      Update Configurator Simulation Configuration · b08338c8
      Jérome Perrin authored
      Configuration generated by Standard Configurator was not really good. For most divergences, there was no solvers configured, so users could not configure divergences. Now solvers (for packing lists) are configured so that every divergence is automatically accepted, we only expect user to take a decision when quantity or resource is different.
      This change was implemented in the rules from `erp5_configurator_trade_template`, but because several simulation tests were relying on the fact that "changing anything would cause a divergence" the previous rules configuration are kept in a new `simulation_test_trade_template`.
      
      Also, security configuration was incomplete, since the introduction of "new simulation", some Unauthorized errors occurred when non-manager users where trying to solve divergence. This is now solved and exercised in the integration tests we run on auto-configurated instance. 
      
      The configuration was obsolete, nowadays we use different business processes for each use case, this configuration was still using only one business process for both sale and purchase, now we use two and improve the accounting configuration, to use accounts defined in supply line.
      
      Some others small improvements were made, for example now we can configure the delivery solver to use for a split solver once and for all in the solver and user does not have to choose each time.
      
      What not updated this time:
       - divergences on Invoice Lines: this is probably same as on Packing List before these changes
       - rules are still configured with ad-hoc scripts and not based on trade phase categories.
      
      See merge request !1221
      b08338c8
    • Jérome Perrin's avatar
      Fix translations with ${portal_type} variables · 349258e5
      Jérome Perrin authored
      See merge request !1236
      349258e5
    • Jérome Perrin's avatar
      BusinessTemplate: update tools, except legacy tools · a52c7d5d
      Jérome Perrin authored
      Since 248f59e5 (Business Template: Likewise ERP5Site.addERP5Tool(), do
      not re-create Tool if it already exists., 2020-06-22) we no longer
      update tools, because of the problem that business template does not
      currently handle updating objects with lots of sub-objects.
      
      But we realized that we really need to update tools when they contain
      configuration as object attributes, like mimetypes_registry, where the
      problem was observed.
      
      Instead of unconditionnally skipping any tool during update, we only
      skip the ones that were initially managed by ERP5Generator and are moved
      to business templates.
      a52c7d5d
    • Jérome Perrin's avatar
      officejs_support_request_ui: use "Submit New Support Request" for form name · 18484163
      Jérome Perrin authored
      to match the button on the front page
      18484163
    • Jérome Perrin's avatar
      ui_test_core: support updating snapshot image behind virtual host · e37dfeb6
      Jérome Perrin authored
      With virtualhosting, there can be an empty path element at the beginning
      of the path.
      e37dfeb6
  3. 11 Aug, 2020 2 commits
  4. 10 Aug, 2020 2 commits
  5. 07 Aug, 2020 10 commits
  6. 06 Aug, 2020 8 commits
  7. 05 Aug, 2020 4 commits
  8. 04 Aug, 2020 4 commits