1. 17 Mar, 2022 5 commits
    • Jérome Perrin's avatar
      01d73a50
    • Jérome Perrin's avatar
      Workflow: add a simple _checkConsistency implementation · d1be5248
      Jérome Perrin authored
      For now only checks that error_message is missing, but later we might
      extended this to perform more check on the workflow definition.
      d1be5248
    • Jérome Perrin's avatar
      core_test: increase expected value testWorkflowHistoryList.TestDedup · 0eca529a
      Jérome Perrin authored
      After df85ef46 (ERP5Workflow: DC Workflows are now ERP5 objects (!1378).,
      2020-11-18) we increased the expected value from 24 to 36, because it
      was just different with new workflow implementation and what was important
      is to have large buckets.
      
      After that, the test was flaky and eventually we changed the assertion
      from checking that the value equal the expected value to checking that
      it's larger to checking that it's larger to a satisfying value and we
      used the initial 24 for satisfying value.
      
      A large value here means the bucket contain many items, which happens
      when the pickle size is small
      
      We now understand that pickle are short when the pickler was able to
      deduplicate some strings because they were the same instances (as
      compared by `is` operator). Note that this deduplication happens before
      the one operated by Products.ERP5Type.Workflow.dedupStrings after bucket
      rotation, it's the "normal" deduplication from pickle happening when
      element are added to list.
      
      Because it's a good thing for disk usage to have small pickles, we raise
      our expectation and increase the expected minimal value to be 30.
      0eca529a
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      component: fix error_message saved in every line of history · 8a335cca
      Jérome Perrin authored
      Because error_message variable was missing in component_validation_workflow,
      once the validation was refused for an error, every subsequent entry
      in workflow history was carrying the same error message.
      
      Adding the missing variable fix this, but it would cause diff every time
      we modify and re-export a component, so we also take care of not exporting
      it in business template, like we already did for other several variables.
      8a335cca
  2. 11 Mar, 2022 2 commits
  3. 10 Mar, 2022 5 commits
    • Vincent Pelletier's avatar
      CMFActivity.Activity.SQLBase: Factorise validation processing_node threshold · c629ee70
      Vincent Pelletier authored
      Avoid repeating processing_node condition for every single activity
      whose serialization_tag dependency is being checked. This reduces the
      length and execution complexity of produced SQL.
      c629ee70
    • Jérome Perrin's avatar
      Stop including empty items in dialog multilistfields · 9fc690ed
      Jérome Perrin authored
      The meaning of empty items for **multi** list fields for categories is
      not clear for dialogs (if user does not want to apply any filter, then
      the natural way would be to select nothing).
      
      This also caused issues with category fields, when the action script
      uses restrictedTraverse to get the uids corresponding to the category
      but a path is empty, like for example in 
      https://lab.nexedi.com/nexedi/erp5/blob/d51bb0413a806b3db0c5eb69dec06065b9601322/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTrialBalanceReportSectionList.py#L40-48
      
      which does this:
      
      ```python
      # optional GAP filter
      node_uid = []
      gap_uid_list = []
      for gap in request.get('gap_list', ()):
        gap_uid_list.append(portal.portal_categories.gap.restrictedTraverse(gap).getUid())
      if gap_uid_list:
        node_uid = [x.uid for x in portal.portal_catalog(
                                         portal_type='Account',
                                         default_gap_uid=gap_uid_list)] or -1
      ```
      
      If an empty item is selected, then `gap_uid_list` will contain an entry for 
      `portal.portal_categories.gap.restrictedTraverse('').getUid()` which will be the
      uid of the gap base category. Searching with a base category uid nowadays does not
      match any document, but before 95e3eaec (CMFCategory: Do not index any Base Category
      as a related document., 2016-12-21), it was matching all documents having a relation
      from this base category and in the case of this trial balance report it was matching all
      accounts.
      
      This was a problem for old instances with accounts created before 95e3eaec, because when
      they were first indexed, they had the record in category table, so they were matched, but
      once they get re-indexed, they no longer had the record, so the result of this report when
      selecting the empty item became different, because accounts were no longer included.
      
      Looking back at this, maybe when updating to get 95e3eaec, we should have ran a migration
      to delete all these records (re-indexing every document in the background should be enough)
      so that if there's a problem, the problem happens right now and not after a few months
      after accounts are modified and re-indexed.
      
      When looking at this from end user level, theses empty items not only cause this problem,
      but also does not have a clear behaviour and are not needed, so the changes here are about
      removing these empty items.
      
      In accounting reports, there was a multi listfield showing all gap categories, "grouped" by
      chart of account - but the name of the chart of account was not displayed. This change to
      use a None item, which is rendered as disabled to display the chart of account name, but to
      do this we had to fix a bug in Formulator, these disabled items were only working properly
      for single item widgets, not multiple items widgets.
      
      See merge request nexedi/erp5!1572
      9fc690ed
    • Jérome Perrin's avatar
      Fix logins not published · 7b3839a5
      Jérome Perrin authored
      This addresses a regression from !1561 changing the class hierarchy caused Login to loose its docstring and became no longer publishable.
      
      This was problematic because it was not detected by the test suite, so HTML test is changed to use zope publication instead of calling the view on the context.
      
      Another notable point is that this behaves differently in ERP5JS, the Logins were still visible in ERP5JS. Because we don't actually rely on "no docstring on the class" to prevent publication, this is not changed.
      
      See merge request !1571
      7b3839a5
    • Jérome Perrin's avatar
      corporate_identity: fix markup in table of content · 1a5c5ace
      Jérome Perrin authored
      There was opening and closing tags mismatch:
          <div><a href="#references1_anchor">References</div></a>
      1a5c5ace
    • Jérome Perrin's avatar
      Localizer: drop support for dtml-gettext tag · ba8750a2
      Jérome Perrin authored
      This seems to be used only in Localizer's ZMI. This is not compatible
      with newer version of DocumentTemplate, but because we don't use, it's
      better to remove the functionality
      ba8750a2
  4. 08 Mar, 2022 8 commits
  5. 07 Mar, 2022 7 commits
  6. 03 Mar, 2022 4 commits
  7. 02 Mar, 2022 1 commit
  8. 28 Feb, 2022 2 commits
    • Arnaud Fontaine's avatar
      testBusinessTemplateTwoFileExport: Make output_encoding explicit as it should have always been. · 968991e7
      Arnaud Fontaine authored
      This fixes a failure due to Zope4 now defaulting to utf-8.
      968991e7
    • Jérome Perrin's avatar
      Check global consistency in configurator tests · 8ba25690
      Jérome Perrin authored
      Use `portal_alarms/check_consistency` after configuration to make sure that every document created by configurator or part of the dependency business template is valid.
      
      For now we have two exceptions (that are some TODO for the future):
       - Web Sites, because upgrader constraints are not ran by configurator at this point
       - Business Configuration, because most of the configurator item classes don't fully follow the protocol of constraints, their `fixConsistency` method always return "something needs to be fixed" without actually checking.
      
      See merge request !1562
      8ba25690
  9. 24 Feb, 2022 6 commits
    • Xiaowu Zhang's avatar
      2d0c1169
    • Vincent Pelletier's avatar
    • Vincent Pelletier's avatar
      erp5_core_test testERP5Catalog: Do not compare creation_date with modificatoin_date · c06e2069
      Vincent Pelletier authored
      Creation date is defined as the oldest date of any workflow history on the
      considered document.
      Modification date is defined as the newest date of any workflow history
      on the considered document.
      As soon as there is more than one workflow on a given document, these
      values can differ: they are set with the wall-clock time at the moment
      the workflow history of each workflow is initially filled, so one can land
      just before a second change and the other right after.
      So comparing them is meaningless, catalog or not, and just causes this test
      to be unstable.
      c06e2069
    • Jérome Perrin's avatar
      configurator: create account matching constraint · f14403d5
      Jérome Perrin authored
      Because we want to check consistency on all documents created by
      configurator, we also need documents created during the test to be
      consistent (or deleted)
      f14403d5
    • Jérome Perrin's avatar
      *: fix trade phase duplication in erp5_simulation_test and erp5_configurator_standard_categories · 416c6212
      Jérome Perrin authored
      We had trade phase duplication:
       - `trade_phase/default/*` were provided by erp5_simulation_test
       - `trade_phase/trade/*` are provided by erp5_configurator_standard_categories
      
      so the former was only for testing and the later were actually used in
      instance configured by configurator.
      
      But in some paths from configurator_standard_*template, which are also
      used on configurated instances, were using trade_phase/default (the one
      from test). Some rules were referencing these categories, but apparenlty
      not using them.
      
      To fix this confusion, use trade_phase/trade/* everywhere, and install
      erp5_configurator_standard_categories where needed in tests.
      416c6212
    • Jérome Perrin's avatar
      configurator: fix some BusinessConfiguration methods · d4a9d1c3
      Jérome Perrin authored
      BusinessConfiguration have a resource category, but it's the workflow,
      it's not really a resource, so some APIs from the base Amount class are
      not available. Because they have no meaning on BusinessConfiguration
      anyway, define the broken APIs to return nothing.
      
      This fixes errors trying to use check_consistency alarm on Business
      Configurations.
      d4a9d1c3