An error occurred fetching the project authors.
  1. 21 Aug, 2023 1 commit
  2. 12 Jan, 2023 1 commit
    • Jérome Perrin's avatar
      accounting: keep "??? (value)" to display invalid bank account · 784c5ab2
      Jérome Perrin authored
      The changes from ae15e7e1 (accounting: show the context when
      showing invalid bank accounts, 2022-12-21) were a regression because
      with the previous behaviour, by just looking at the transactions,
      users could see with the ??? that something was wrong with the bank
      account. After these changes they had to open the select element.
      
      This restore somehow the previous behaviour by displaying the label
      with ??? marker, but since we have the label, we display the
      label (bank account reference) instead of the value (the relative URL)
      784c5ab2
  3. 11 Jan, 2023 4 commits
  4. 28 Dec, 2022 1 commit
  5. 19 Dec, 2022 1 commit
    • Jérome Perrin's avatar
      *: rewrite with lib2to3.fixes.fix_asserts and ad-hoc assertin · 2e366054
      Jérome Perrin authored
      The add-hoc assertin filter:
      
      --
      
      from typing import List
      
      import lib2to3
      
      from lib2to3.fixer_base import BaseFix
      from lib2to3.fixer_util import Comma, Name
      
      class FixAssertIn(BaseFix):
      
        PATTERN = """
            power< any+ trailer< '.' meth=("assertTrue" | "assertFalse")>
            trailer< '('
              comparison< (needle=any ( comp_op<'not' 'in'> | 'in' ) haystack=any) >
            ')' > >
        """
      
        def transform(self, node: lib2to3.pytree.Node,
                      results: List[lib2to3.pytree.Base]):
      
          needle = results['needle']
          haystack = results['haystack']
          meth = results["meth"][0]
      
          method_map = {True: 'assertIn', False: 'assertNotIn'}
          method_in = meth.value == 'assertTrue'
          if 'not' in str(needle.parent.children[1]):
            method_in = not method_in
          meth.replace(Name(method_map[method_in], prefix=meth.prefix))
      
          needle.parent.children = [needle, Comma(), haystack]
      2e366054
  6. 12 Dec, 2022 1 commit
  7. 17 Nov, 2022 1 commit
  8. 10 Nov, 2022 1 commit
    • Jérome Perrin's avatar
      accounting: support more cases of grouping internal invoices · aebfb199
      Jérome Perrin authored
      The logic to guess groupable lines was considering source of
      destination side of an accounting transaction depending on
      preferences. This was not good, for two reasons:
       - with internal transactions we want to consider both the source
        and the destination
       - if user preferences are mis-configured, grouping would not work.
      
      switch to a logic where we consider both source and destination
      sides to prevent these problems.
      aebfb199
  9. 24 Oct, 2022 1 commit
    • Jérome Perrin's avatar
      accounting: round in grouping when no section currency is set · 3e5ca320
      Jérome Perrin authored
      Grouping feature checks that the sum of all selected lines == 0, which
      is often not the case as the values are float. For that, our approach
      is to round the values with the precision of the accounting currency,
      since these precisions are usually small (typically 0, 2 or 3), we
      don't have problems with rounding. Using the section currency is not
      just a workaround for rounding, it's also correct because we don't
      consider more precise amounts in accounting transaction lines.
      
      The problem with this approach was for the case where no accounting
      currency is set on the section organisation, in that case we did not
      round and this sometimes led to "grouping is impossible" errors that
      are hard to find for users. At this level it's better to use a default
      rounding precision that would make it possible to use the grouping
      feature even when section currency is not set.
      3e5ca320
  10. 24 Jan, 2022 1 commit
  11. 23 Apr, 2021 1 commit
    • Arnaud Fontaine's avatar
      ERP5Workflow: DC Workflows are now ERP5 objects (!1378). · df85ef46
      Arnaud Fontaine authored
      This also moves all Configurator Workflows in workflow_module to portal_workflow
      (workflow_module was an implementation of Workflows based on ERP5 objects and
      not using DCWorkflow code).
      
      * Workflows are now defined on on portal_workflow._chains_by_type anymore but,
        as everything else, on the Portal Type itself.
      * portal_workflow can contain and work at the same time with legacy and new
        Workflows (ERP5Type/patches/DCWorkflow.py monkey-patching DCWorkflow classes
        to provide the same API).
      * Existing Workflow Scripts should work as they are and the code can be updated
        later on to take advantage of the new API:
        + With legacy implementation Workflow {Scripts,Transitions,Worklists,States}
          were in a Folder ({scripts,transitions,worklists,states} attribute) but
          all of these are now in the Workflow itself and their IDs are prefixed
          (PropertySheet-style), for example `script_`. Legacy attributes are
          provided in new implementation to call the new API.
        + When calling a Workflow Script, `container` was bound to its parent, namely
          WF.scripts (Folder) and a Workflow Script could call another. Now `container`
          is bound to the WF itself and Workflow Scripts are in a Workflow directly.
          New implementation `scripts` attribute handle such use case.
        + Override portal_workflow.__getattr__ so that a Workflow Script can call
          another one without prefix.
      * Worklist are Predicate: Worklist filter objects based on given criterions and
        thus it makes more sense for a Worklist to be a Predicate (albeit a Predicate
        with only Identity Criterion and nothing else).
        + Criterion Properties:
          * state_variable.
          * local_roles (SECURITY_PARAMETER_ID).
          * Any Workflow Variables with for_catalog == 1.
      
      erp5_performance_test:testWorkflowPerformance were ran to compare DCWorkflow
      and ERP5Workflow implementations and it seems to be about 4% slower with the
      new implementation (legacy: 7.547, 7.593, 7.618, 7.59, 7.514 and new: 7.842,
      7.723, 7.902, 7.837, 7.875).
      
      Work done by Wenjie Zheng, Isabelle Vallet, Sebastien Robin and myself.
      df85ef46
  12. 25 Mar, 2021 1 commit
    • Jérome Perrin's avatar
      accounting: Fix "Account Type must be set" constraint not always applying · 973ffdef
      Jérome Perrin authored
      This constraint had a TALES expression making it not apply on invalidated
      accounts, but during the transition invalidated -> validated, when the account's
      consistency is checked, the account is still in invalidated state, so that
      check was ignored, making it possible for users to validate an account without
      and account type.
      973ffdef
  13. 03 Mar, 2021 1 commit
  14. 19 Jan, 2021 1 commit
    • Jérome Perrin's avatar
      accounting: Fix timezone issues when checking periods are consecutive · 307470e2
      Jérome Perrin authored
      Opening an accounting period is refused if the start date of the period
      is more than one day after the stop date of the previous period, but this
      check did not take into account that "next day" might be more than 24
      hours, like it's the case when daylight saving happen between these dates.
      Instead we check that the difference is less than 1.9 days.
      
      Reorganise tests to group accounting period related tests in a dedicated
      test class and add missing tests for period validation checks.
      
      Also fix a few race conditions with catalog indexing that are probably not
      a problem in real life but were revealed by the test.
      307470e2
  15. 11 Nov, 2020 1 commit
  16. 24 Sep, 2020 1 commit
    • Jérome Perrin's avatar
      accounting: fix validation of accounting transactions with too precise amounts · 07e817df
      Jérome Perrin authored
      Round the amounts line by line when validating transactions balances and
      showing the totals on an accounting transaction.
      
      Even though float field configurations do not allow users to input transactions
      where amounts uses more digits that what makes sense for the selected currency,
      we had cases where some transactions generated by custom scripts were "too
      precise" and passed the validation because unlike in all reports where we
      display sum of rounded values, the check was only rounding the sum, which cause
      some transactions with 1.00 on one side and 0.333333 0.333333 and 0.333333 on
      the other side to be valid.
      
      The scripts used to display sums on an accounting transaction had the same
      problem, they were also showing the rounded sum and not the sum of rounded
      values.
      07e817df
  17. 07 Sep, 2020 1 commit
  18. 23 Apr, 2020 2 commits
    • Arnaud Fontaine's avatar
      ZODB Components: erp5_trade: Migrate Documents, Interfaces and Mixins from filesystem (MR !1101). · 85417113
      Arnaud Fontaine authored
      * Remove TaxLine Document which was replaced by Trade Model Line a while ago.
      * Keep {Delivery,Inventory,Order}{Cell,Line} on FS for now because of InventoryInteractor.
      * About DeliveryRootSimulation Document migration to erp5_trade:
        + AccountingTransactionRootSimulationRule (erp5_accounting) inherited from
          it but as this is probably not actually used/useful, avoid depending on
          erp5_trade or refactoring but just copy/paste.
        + InvoiceRootSimulationRule inherited from it but as it is only used in
          erp5_invoicing (which already depends on erp5_trade) move it there.
          - erp5_configurator_standard_accounting_template: Add depend on erp5_invoicing.
      * Move Documents used by several bt5 to erp5_core rather than add depends on erp5_core.
        Once migration of Products to ZODB Components will be finished, there will be moved to
        their appropriate bt5s as it would be complicated to reorganize bt5s too at this point.
        + Inventory: used by erp5_archive and erp5_accounting.
        + Order: used by erp5_project.
        + PackingList: used by erp5_publication.
      85417113
    • Arnaud Fontaine's avatar
      ZODB Components: erp5_invoicing: Migrate Documents from filesystem. · d810bfaf
      Arnaud Fontaine authored
      * Add bt5 dependencies:
        + erp5_demo_maxma_rule: Invoice*Rule rules.
      * Move Documents used by several bt5 to erp5_core rather than add depends on erp5_core.
        Once migration of Products to ZODB Components will be finished, there will be moved to
        their appropriate bt5s as it would be complicated to reorganize bt5s too at this point.
        + Invoice{Line,Cell}: used by erp5_payroll.
      d810bfaf
  19. 14 Feb, 2020 1 commit
    • Jérome Perrin's avatar
      tests: don't run coding style tests in unit tests · dab1dd86
      Jérome Perrin authored
      We run them in coding style test suite already.
      
      Also these test now need business template repository properly
      configured in template tool, which is not set in default setup, so
      keeping them working would require extra work.
      dab1dd86
  20. 16 May, 2019 2 commits
  21. 28 Mar, 2019 1 commit
    • Jérome Perrin's avatar
      accounting: reset grouping reference in a "context free" script · 439ff1b3
      Jérome Perrin authored
      Introduce a new ERP5Site_resetAccountingTransactionLineGroupingReference
      script to reset grouping reference on accounting transaction lines.
      
      This solve a problem with the way we activated on
      AccountingTransactionLine_resetGroupingReference the context of the
      line, if line was removed from OFS before activity was executed, the
      activity was discarded and grouping references on related lines was not
      reset.
      
      Also drop the unused `keep_if_valid_group` parameter, it was not making
      sense.
      
      /reviewed-on nexedi/erp5!849
      439ff1b3
  22. 25 Mar, 2019 2 commits
  23. 20 Mar, 2019 1 commit
  24. 19 Nov, 2018 1 commit
  25. 24 Jan, 2018 1 commit
    • Vincent Pelletier's avatar
      all: Avoid trivial direct calls to {recursiveI,i}mmediateReindexObject · ab9e0f93
      Vincent Pelletier authored
      These methods must not be called synchronously:
      - they can break catalog by not being careful enough about other
        reindexations which may happen in parallel. See the serialization_tag
        mechanism for more.
      - indexation gets executed in the security context of the user causing the
        call, which may lead to an indexation result different from what happens
        when indexation happens with an all-accesses user.
      These lines of code (some even commented-out) give a bad example. Replace
      them with safe equivalents.
      ab9e0f93
  26. 04 Oct, 2017 1 commit
  27. 05 Jul, 2017 2 commits
  28. 19 Jun, 2017 2 commits
  29. 16 Jun, 2017 1 commit
  30. 09 Mar, 2017 1 commit
  31. 18 Jan, 2017 1 commit
  32. 06 Dec, 2016 1 commit