1. 31 Oct, 2022 1 commit
  2. 24 Oct, 2022 2 commits
    • Thomas Gambier's avatar
    • 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
  3. 21 Oct, 2022 3 commits
    • Jérome Perrin's avatar
      core: Fix unicode bug on ZODB History view. · 0162ede8
      Jérome Perrin authored
      Some objects, in our case BTrees.Length.Length in a ZODB connection
      have a __str__ method that returns unicode on python2:
      
      u'<BTrees.Length.Length object at 0x7f850932e0d0 oid 0x1e334 in <Connection at 7f854bc0f190>>'
      
      They cause an unicode error in the history view when they are
      concatenated together with other str (encoded as UTF-8) properties,
      this can be observed when using history view with a "folderish"
      document (but not with a File as in test_ZODBHistoryBinaryData).
      
      To prevent this issue, we use the fact that ''.format unlike '' %
      seem to apply a str() on arguments and use it instead.
      Co-authored-by: Yusei Tahara's avatarYusei Tahara <yusei@nexedi.com>
      0162ede8
    • Yusei Tahara's avatar
      erp5_core: Fix unicode bug on ZODB History view. · 7d32a4f9
      Yusei Tahara authored
      Some objects become unicode when %s is applied and may cause
      UnicodeDecodeError, thus use %r insead.
      7d32a4f9
    • Yusei Tahara's avatar
      Revert "erp5_core: Fix unicode bug on ZODB History view." · d12f3483
      Yusei Tahara authored
      This reverts commit 40fded3e.
      
      It is not good to mix unicode and str for UI. Use utf8 str only.
      d12f3483
  4. 19 Oct, 2022 5 commits
  5. 18 Oct, 2022 1 commit
  6. 17 Oct, 2022 5 commits
  7. 13 Oct, 2022 1 commit
  8. 12 Oct, 2022 1 commit
  9. 11 Oct, 2022 1 commit
  10. 07 Oct, 2022 2 commits
  11. 06 Oct, 2022 3 commits
    • Jérome Perrin's avatar
      ERP5Type/patches: drop make_hidden_input patch · 4f9efc60
      Jérome Perrin authored
      we had a patch to close <input/> elements, but with HTML5 this is no
      longer recommended.
      4f9efc60
    • Jérome Perrin's avatar
      BusinessTemplate: also sort some path properties · a2bfd4e3
      Jérome Perrin authored
      template_keep_path_list, template_keep_workflow_path_list and
      template_keep_last_workflow_history_only_path_list were not sorted
      for no reason
      a2bfd4e3
    • Jérome Perrin's avatar
      BusinessTemplate: sort properties when saving them · a4a136d7
      Jérome Perrin authored
      The _getOrderedList approach was not ideal, because the properties were
      saved when being displayed, so the typical workflow was:
      
       1. enter the property as non sorted
       2. click save (property is saved as non sorted)
       3. the page displays the property again as sorted
       4. click save again so that the property is saved as sorted
      
      by sorting the properties at save time, step 1 is enough
      
      This change back the accessors to be "standard" accessors, ie. returning
      lists, like every other list accessors, so a few tests and a few scripts
      had to be adjusted for the new API.
      a4a136d7
  12. 05 Oct, 2022 14 commits
  13. 04 Oct, 2022 1 commit