1. 25 Jun, 2021 7 commits
    • Jérome Perrin's avatar
      commerce: update session after modifying shopping cart content · bf6d7927
      Jérome Perrin authored
      when using a RAM cache for session, we can modify the temp objects directly
      and the changes are kept, because the same object kept in RAM is accessed by
      subsequent requests, but when using memcached every request get a different
      object, so we need to put back the object in the session so that the new
      version is saved in cache, so that subsequent requests use the modified object
      bf6d7927
    • Jérome Perrin's avatar
      commerce: clear sessions between tests · 608635ea
      Jérome Perrin authored
      When sessions uses a RAMCache, the portal_caches.clearAllCache is enough to
      reset the session, but not when using a distributed cache.
      608635ea
    • Jérome Perrin's avatar
      core: implement Session.update · bac5ff3f
      Jérome Perrin authored
      It was using the default UserDict.update implementation which did not remove
      acquisition wrapper and eventually lead to ConnectionStateError like for example
      
      > Shouldn't load state for erp5.portal_type.Interaction Workflow Interaction 0x6637 when the connection is closed
      
      which was observed when deleting sale order lines (wich triggers some interaction)
      bac5ff3f
    • Tristan Cavelier's avatar
      erp5_core: change erp5_session cache type to Distributed Ram Cache · f2d5b043
      Tristan Cavelier authored
      Previously `Ram Cache` was used, causing anonymous clients to never use portal_session properly.
      Mainly for public forum captcha purpose.
      Now `Distributed Ram Cache` is used to share the session between the zope nodes.
      It's required to restart all zope nodes after this BT5 upgrade.
      f2d5b043
    • Jérome Perrin's avatar
      SessionTool: support storing temp objects · 06be6573
      Jérome Perrin authored
      This was only supported for the RAMCache version of session tool, but is also
      good to support them in DistributedRamCache, so that we can use DistributedRamCache
      by default.
      
      One breaking change is that when using RAMCache, changes made to temp objects
      in session were persisting for the session lifetime, after this change, each
      time we get the object from the session we get a new fresh object, so if we
      make change we have to explicitly put it back to the session, which is surprising
      for developers used to the convenience of ZODB transparent persistence.
      06be6573
    • Jérome Perrin's avatar
      core_test: modernize and extend testSessionTool · 41b86818
      Jérome Perrin authored
      Stop using Sequence, use more high level assertion methods instead of
      self.assert_, define the shared tests in a test case and make tests for each
      cache plugins inherit from the test case.
      
      Also add a few tests:
        - storing temp objects in Distributed cache
        - storing "recursive" temp objects (like a sale order with sale order lines)
      41b86818
    • Jérome Perrin's avatar
      ERP5Type: allow pickling temp objects · 20f0f6dc
      Jérome Perrin authored
      What should not be allowed is to store persistent objects in ZODB, but pickling
      them should be OK. This is necessary if we want to store them in memcached.
      
      This also modifies loadTempPortalTypeClass which was returning a class with a
      different name than requested, by prepending "Temporary ". This prevented
      pickling, because pickle checks that the class is can be imported under its
      same name. This was problematic because before this change, we had such a behavior:
      
          (Pdb) tmp = self.portal.person_module.newContent(portal_type='Person', temp_object=True)
          (Pdb) tmp.__class__
          <class 'erp5.temp_portal_type.Temporary Person'>
          (Pdb) import erp5.temp_portal_type
          (Pdb) getattr(erp5.temp_portal_type, 'Temporary Person')
          <class 'erp5.temp_portal_type.Temporary Temporary Person'>
      
      My understanding is that this prefix in the class name was not useful, that
      class lives in another module than the "real" Person class.
      20f0f6dc
  2. 23 Jun, 2021 1 commit
  3. 21 Jun, 2021 2 commits
  4. 18 Jun, 2021 2 commits
    • Jérome Perrin's avatar
      tests: also consider python unittest failures in functional tests · 1b1dbf60
      Jérome Perrin authored
      It can happen that a test running selenium fail in python, but not in selenium,
      like for example test_result_module/20210615-CDADEC14/183
      To prevent such tests from being reported as PASS, we make the total number of
      failures being the sum of the python unittest failures and the selenium failures.
      1b1dbf60
    • Jérome Perrin's avatar
      ERP5TypeFunctionalTestCase: wait for test table to be populated · 3fe3ef2c
      Jérome Perrin authored
      It happens, for example with erp5_officejs_ui_test:testFunctionalOfficeJSPyodideNotebook
      on test_result_module/20210615-CDADEC14/183 that the test is considered as
      not running, because the test result table was not populated in time.
      
      Add an explicit wait to prevent such problems.
      3fe3ef2c
  5. 17 Jun, 2021 6 commits
  6. 15 Jun, 2021 6 commits
  7. 14 Jun, 2021 2 commits
  8. 11 Jun, 2021 3 commits
  9. 10 Jun, 2021 1 commit
  10. 09 Jun, 2021 2 commits
    • Jérome Perrin's avatar
      core: keep using default_params from proxy listbox ids · afa5c0fc
      Jérome Perrin authored
      With bf57228a ([erp5_core] RelationField listbox must also fetch
      default_params value from the relationfield, 2018-05-09), we introduced a
      regression that listboxs from relation fields "proxy listbox ids" default params
      where no longer used. As a result, if we have a listbox which define some
      catalog search with default parameters, like for example the "Suppliers" or
      "Clients" listboxs from erp5_trade are doing, these parameters were not
      taken into account. In the case of trade listbox, this was showing all nodes.
      
      This changes Base_getRelatedObjectParameter to get catalog search from the
      proxy listbox if there is one.
      afa5c0fc
    • Jérome Perrin's avatar
      trade_renderjs_ui_test: tests for "Suppliers", "Clients", "Organisations" and... · f67f5346
      Jérome Perrin authored
      trade_renderjs_ui_test: tests for "Suppliers", "Clients", "Organisations" and "Persons" Proxy Listbox Ids
      f67f5346
  11. 08 Jun, 2021 5 commits
  12. 07 Jun, 2021 1 commit
  13. 04 Jun, 2021 2 commits