1. 29 Oct, 2024 18 commits
    • Gabriel Monnerat's avatar
      CUSTOM: hide columns to select and edit because are useless to display last Suport Requests · c24d08c5
      Gabriel Monnerat authored
      > email from Galien Renault with title "Retour livraison interface consulaire" document "Retour livraison
      > Interface Consulaire ERP5 .pdf" Suppression des boutons d’action : ““Edit” / “Select”, page 4.1.4 item a page 14
      c24d08c5
    • Gabriel Monnerat's avatar
      CUSTOM erp5_crm: Hide action "Make a template" to Support Request · 255c538a
      Gabriel Monnerat authored
      Requested in an email from Galien Renault with title "Retour livraison
      interface consulaire" document "Retour livraison Interface Consulaire
      ERP5.pdf", section 4.1.4d page 16
      255c538a
    • Gabriel Monnerat's avatar
      CUSTOM erp5_crm: Remove action to create new event in Support Request · 36a2bdb0
      Gabriel Monnerat authored
      Requested in an email from Galien Renault with title "Retour
      livraison interface consulaire" document "Retour livraison Interface
      Consulaire ERP5.pdf", part 3.2.2c page 10
      
      - Il devrait être impossible de crée"New Event" pour un
      ticket au statut "Closed"
      
      This action is not suppose to work, because they should a new post in the Suppport Request instead of a new event directly.
      36a2bdb0
    • Gabriel Monnerat's avatar
      erp5_officejs_support_request_ui: Avoid to hardcode sort_on in the python script · 015f645b
      Gabriel Monnerat authored
      Because this breaks the sort and filter buttons in the new ERP5 UI
      015f645b
    • Gabriel Monnerat's avatar
      CUSTOM erp5_officejs_support_request_ui: Display causality reference(Visa File... · 28f38e7c
      Gabriel Monnerat authored
      CUSTOM erp5_officejs_support_request_ui: Display causality reference(Visa File Reference) from Support Request
      
      Requested in an email from Galien Renault with title 'Retour livraison interface consulaire' document 'Retour livraison Interface Consulaire ERP5.pdf' V1.0 2020-04-31 section 3.2.1 page 9 and 3.1.9d page 8.
      
      - Rajouter la colonne "Visa Files Reference" en valeur par défaut de l liste 'Recent Update'
      - La valeur du champ "Visa File Reference" doit etre la reference TESTVFXXX et non le nom du requester
      28f38e7c
    • Gabriel Monnerat's avatar
      CUSTOM erp5_crm: disable "Attach Document" action on support request · 28e0ef49
      Gabriel Monnerat authored
      In this custom support request app, document are sent as items in packing lists
      and the default "Attach Document" action is confusing, because we have a
      "Create New Document" action which creates the document as an item with its
      initial implicit movement.
      28e0ef49
    • Jérome Perrin's avatar
      accounting: rework Organisation_getMappingRelatedOrganisation ( WIP ) · 8fbd61f5
      Jérome Perrin authored
      This script was returning organisations in random order !
      
      When organisation does not have accounting periods, but another organisation at the same level of the same group has, the result was undefined.
      
      This fixes by considering all organisation from the same group.
      8fbd61f5
    • Gabriel Monnerat's avatar
    • Jérome Perrin's avatar
      WIP: Inventory api: interpolation + group by time sequence · 594ef323
      Jérome Perrin authored
      jerome/erp5!6 rebased and in a big
      commit so that we can start using that
      SimulationTool: implement "linear" flow API
      
      testInventoryAPI: silent pyflakes warnings
      
      more interpolation implementation
      
      inventory_list interpolation flow: support at_date & to_date
      
      more and more interpolation API
      
      interpolation
      
      interpolation
      
      group_by_time_sequence_list
      
      testInventoryAPI: move inventory valuation methods in a dedicated test class
      
      This should not be in test inventory list.
      
      test: move Tracking API to a dedicated test module
      
      inventory api: dirty way of disabling cache if keys such as node_category are used.
      
      interpolation: security on SimulationTool_zGetInterpolationMethod
      
      SimulationTool_zGetInterpolationMethod is called in restricted context
      of Resource_zGetMovementHistoryList so it needs to be usable by
      anonymous.
      
      ZSQL Method does not read parameters from REQUEST, so it looks safe.
      
      inventory_api: rely on catalog to add slot_index in the query
      
      instead of implementing this logic in ZSQL's DTML
      594ef323
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      ERP5: workaround Domain.getPrice that cannot lookup price · 5bc23696
      Jérome Perrin authored
      because Domain.getRelativeUrl (and Category.getRelativeUrl) cannot be
      restrictedTraverse'd
      5bc23696
    • Jérome Perrin's avatar
      core,monaco_editor: python language support 🚧 · 8cab6649
      Jérome Perrin authored
      some work in progress changes to improve developer experience
      
      monaco_editor: increase debounce timeout for pylint checks XXX
      
      on very large python files (>1000 lines) sometimes they queue up and we
      have to wait for all requests that were queued by zope.
      
      XXX maybe this does not happen when accessing through haproxy/apache, I
      am observing this when hitting zope directly
      
      jedi: generate stubs WIP
      
      ERP5: "quick and dirty" type annotations XXX
      
      IIRC the only thing needed is that ERP5TypeTestCase.getPortal is an
      ERP5Site
      
      monaco_editor: also enable jedi for codelens ( WIP: ZMI only )
      
      core: pass "language support url" to text editors XXX
      
      For now this is just the portal_url, but I'm thinking it could be a
      proper tool.
      
      monaco_editor: enable pylint in gadget version
      
      because pylint is a bit slow on large components, debounce every 2
      seconds. TODO: this is too slow.
      
      monaco_editor: enable formatting provider for python
      
      This makes "Format Document" / "Format Selection" work.
      
      monaco_editor: enable completion provider for python
      
      this makes completions works when using Ctrl+space
      
      monaco_editor: pass portal_type to checkPythonSourceCode
      
      python_support: new business template to act as a language server for python
      
      checkPythonSourceCode: add a cache
      
      When using checkPythonSourceCode integrated in the source code editor,
      for a scenario where developer edit a component and save we can benefit
      from caching the check message for the source code content, because the
      same check that the one happening in the editor will happen when the
      component is saved.
      
      This cache varies on:
       - "component_packages" cache cookie which is reset every time some
      component code is edited.
       - zope startup time to take into account editions of file system code.
      This assumes that after reseting file system code zope will be
      restarted.
       - portal_type, because the checks performed by this function also
      depend on portal type.
      
      jedi wip
      
      administration: keep using pylint only for now
      
      monaco_editor: jedi WIP
      
      core: use mypy to check python code ( WIP experiment )
      
      Revert "core: use mypy to check python code ( WIP experiment )"
      
      This reverts commit cfa27232.
      
      ERP5TypeTestCase: jedi workarounds
      
      monaco_editor: WIP reference provider for python
      
      monaco_editor: jedi wip (no longer use /tmp/)
      
      yapf: adjust config following up Gabriel feedback
      8cab6649
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      ERP5 Page Template 🚧 · a0a45c97
      Jérome Perrin authored
      a0a45c97
    • Jérome Perrin's avatar
      persistent_migration: convert object states with zodbupdate when loading · a7e846c7
      Jérome Perrin authored
      See https://zope.readthedocs.io/en/latest/migrations/zope4/zodb.html
      
      The approach here is to have a ZODB patch to apply zodbupdate on object
      load, decoding with UTF-8 encoding because it will be correct most of
      the time with ERP5
      a7e846c7
    • Arnaud Fontaine's avatar
      WIP: Why? · b4f59359
      Arnaud Fontaine authored
      b4f59359
    • Arnaud Fontaine's avatar
      WIP: py3: ZServer removed. · 8336cc85
      Arnaud Fontaine authored
      8336cc85
    • Jérome Perrin's avatar
      WIP: patches/python: override py3 builtin round to keep py2 behavior. · 4b0d5c13
      Jérome Perrin authored
      And workaround safeimage impacted by this round2 patch.
      4b0d5c13
  2. 28 Oct, 2024 1 commit
    • Jérome Perrin's avatar
      Revert "simulation: introduce Rule.getSimulationMovementSimulationState" · ccadeaa4
      Jérome Perrin authored
      This reverts commit 5e21f77f.
      
      This was done too quickly based on a wrong assumption that simulation
      movements to build would always be in planned state and that we could
      have an efficient way of selecting them by catalog with index on
      portal_type and simulation state, but it does not work this way.
      
      Maybe the change is useful for something else, but since we don't have
      any use case for now, let's just revert.
      ccadeaa4
  3. 25 Oct, 2024 1 commit
  4. 24 Oct, 2024 7 commits
  5. 23 Oct, 2024 4 commits
  6. 16 Oct, 2024 5 commits
    • Jérome Perrin's avatar
      testCRM: use valid email address in the test · 007de00c
      Jérome Perrin authored
      `sender@customer.com <sender@customer.com>` used in the test is not a
      valid email address. We have updated to python3.9.20 which comes with a
      fix for CVE-2023-27043 and no longer allow this kind of broken addresses.
      
      Replace the address with a similar valid address,
      `"sender@customer.com" <sender@customer.com>`, that was probably the
      original intention of this test.
      007de00c
    • Jérome Perrin's avatar
      dms: explicitly cast `path` selected columns to char · ee19f449
      Jérome Perrin authored
      On python3, the type of selected columns depend on the data type from
      mariadb side, VARCHAR will be str, BINARY/BLOB will be bytes, etc
      
      These SQL method select path that is first evaluated from a variable
      that is NULL and in that case, mariadb seems to select LONGBLOB as data
      type:
      
          MariaDB [test]> set @defined_as_null=null; drop table if exists tmp; create table tmp as (select @defined_as_null); show create table tmp;
          +-------+------------------------------------------------------------------------------------------------------------------------------------+
          | Table | Create Table                                                                                                                       |
          +-------+------------------------------------------------------------------------------------------------------------------------------------+
          | tmp   | CREATE TABLE `tmp` (
            `@defined_as_null` longblob DEFAULT NULL
          ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci |
          +-------+------------------------------------------------------------------------------------------------------------------------------------+
      
      By casting to CHAR in SQL, on the python side we always have the str
      that we expect here, because this is used as path attribute of a SQL
      brain.
      ee19f449
    • Jérome Perrin's avatar
      custom_zodb: fix a ResourceWarning · 5349d8c4
      Jérome Perrin authored
      5349d8c4
    • Jérome Perrin's avatar
      ProcessingNodeTestCase: also setRequest in timerserver loop · 6102ed47
      Jérome Perrin authored
      This is similar to 18deb716 (ProcessingNodeTestCase: also setRequest
      in processing_node, 2023-05-02), as said in that commit message,
      timerserver loop calls setRequest, but before entering the loop, we
      wait for the portal to be created with:
      
       447   │           try:
       448   │             self.portal = self.app[self.app.test_portal_name]
       449   │           except (AttributeError, KeyError):
       450   │             continue
      
      While accessing like this, this will load classes and initialize dynamic
      modules, on python2 this was OK, but on python3 this was raising an
      error because `getRequest` returned None:
      
        File "./parts/erp5/product/ERP5Type/dynamic/component_package.py", line 449, in load_module
          return self.__load_module(fullname)
        File "./parts/erp5/product/ERP5Type/dynamic/component_package.py", line 416, in __load_module
          erp5.component.ref_manager.add_module(module)
        File "./parts/erp5/product/ERP5Type/dynamic/dynamic_module.py", line 86, in add_module
          self.add_request(get_request())
        File "./parts/erp5/product/ERP5Type/dynamic/dynamic_module.py", line 64, in add_request
          self.setdefault(last_sync, (WeakSet(), set()))[0].add(request_obj)
        File "./lib/python3.9/_weakrefset.py", line 89, in add
          self.data.add(ref(item, self._remove))
      TypeError: cannot create weak reference to 'NoneType' object
      
      On python2, this was actually raising as well, but this error is hidden
      by a `hasattr`, because on python2 `hasattr` ignores all exceptions and
      on python3 it only ignores only `AttributeError`.
      
        File "./parts/erp5/product/ERP5Type/Core/PropertySheet.py", line 61, in createAccessorHolder
          self.applyOnAccessorHolder(accessor_holder, expression_context, portal)
        File "./parts/erp5/product/ERP5Type/Core/PropertySheet.py", line 175, in applyOnAccessorHolder
          for property_definition in self.contentValues():
        File "./parts/erp5/product/ERP5Type/Core/Folder.py", line 1570, in contentValues
          portal_type_id_list = self._getTypesTool().listContentTypes()
        File "./parts/erp5/product/ERP5Type/Tool/TypesTool.py", line 173, in listContentTypes
          provider_value = _getOb(provider, None)
        File "./eggs/Zope-4.8.7-py2.7.egg/OFS/ObjectManager.py", line 323, in _getOb
          if id[:1] != '_' and hasattr(aq_base(self), id):
        File "./parts/erp5/product/ERP5Type/dynamic/lazy_class.py", line 120, in __getattribute__
          self.__class__.loadClass()
      6102ed47
    • Nicolas Wavrant's avatar
  7. 15 Oct, 2024 4 commits
    • Nicolas Wavrant's avatar
      erp5_web_renderjs_ui: update the interface for gadget_button_maximize · 0fcb4727
      Nicolas Wavrant authored
      And simplify just a bit the code
      0fcb4727
    • Jérome Perrin's avatar
      BusinessTemplate: Fix some lxml warnings for `findall` (!1751). · 6e4d8625
      Jérome Perrin authored
      FutureWarning: This search incorrectly ignores the root element, and will be
      fixed in a future version.  If you rely on the current behaviour, change it to
      './/role'.
      6e4d8625
    • Arnaud Fontaine's avatar
      py3: TestTradeModelLineMixin inherited from UserDict() to store values on the... · 57c609da
      Arnaud Fontaine authored
      py3: TestTradeModelLineMixin inherited from UserDict() to store values on the class direcly (nexedi/erp5!1751).
      
      This does not work with py3:
          File "parts/erp5/Products/ERP5Type/tests/runUnitTest.py", line 941, in main
            result = runUnitTestList(test_list=args,
          File "parts/erp5/Products/ERP5Type/tests/runUnitTest.py", line 703, in runUnitTestList
            result = TestRunner(verbosity=verbosity).run(suite)
          [...]
          File "parts/python3/lib/python3.9/unittest/runner.py", line 184, in run
            test(result)
          [...]
          File "parts/python3/lib/python3.9/unittest/suite.py", line 84, in __call__
            return self.run(*args, **kwds)
          File "parts/python3/lib/python3.9/unittest/suite.py", line 111, in run
            if _isnotsuite(test):
          File "parts/python3/lib/python3.9/unittest/suite.py", line 369, in _isnotsuite
            iter(test)
          File "parts/python3/lib/python3.9/collections/__init__.py", line 1067, in __iter__
            return iter(self.data)
        AttributeError: 'TestComplexTradeModelLineUseCaseSale' object has no attribute 'data'
      
      Use a dedicated dict() to store these values as there was no strong reasons to
      inherit from UserDict() here and this makes test implementation easier too...
      57c609da
    • Jérome Perrin's avatar
      IdTool: Handle group_id on python3 (!1980). · 1f369453
      Jérome Perrin authored
      group_id is used as key of OOBtree and as documented, it's not possible to mix
      keys that can not be compared, so we can not have a mix of string and bytes, for
      consistency with other BTrees, such as the ones used for OFS.
      
      group_id is also used in a SQL column which is BINARY, this is problematic on
      py3 because the selected values will be returned as bytes, but we expect str
      here. Because we don't want to run a data migration, we adjust the select
      methods to convert to str while selecting.
      
      Since years there was a warning that id_group must be a string, now we make it a
      bit stricter, we also enforce that the id_group is valid UTF-8.
      
      A few more tests and assertions were also added.
      1f369453