1. 05 Apr, 2024 3 commits
    • Kazuhiko Shiozaki's avatar
      test: assert total_price with resource's price precision. · b1327d9a
      Kazuhiko Shiozaki authored
      because str(float) result is different between py2/py3.
      
      * py2
      >>> str(-0.8999999999999999)
      '-0.9'
      
      * py3
      >>> str(-0.8999999999999999)
      '-0.8999999999999999'
      b1327d9a
    • Kazuhiko Shiozaki's avatar
      erp5_configurator_standard_invoicing_template: use ROUND_HALF_UP rounding option. · c90400d2
      Kazuhiko Shiozaki authored
      with ROUND_DOWN, we have a different behaviour between py2/py3, that caused failures in
      erp5_simplified_invoicing:testTradeModelLine.
      
      Here is what happened in _round(1.9999999999999998) in
      bt5/erp5_simulation/DocumentTemplateItem/portal_components/document.erp5.FloatEquivalenceTester.py
      
      * py2
      decimal.Decimal(str(1.9999999999999998)).quantize(decimal.Decimal('0.000001'), 'ROUND_DOWN')
      => Decimal('2.000000')
      (because str(1.9999999999999998) is '2.0')
      
      * py3
      decimal.Decimal(str(1.9999999999999998)).quantize(decimal.Decimal('0.000001'), 'ROUND_DOWN')
      => Decimal('1.999999')
      (because str(1.9999999999999998) is '1.9999999999999998')
      
      But ROUND_DOWN result of 1.9999999999999998 with 0.000001 precision should be 1.999999 thus py2 behaviour is wrong.
      c90400d2
    • Jérome Perrin's avatar
  2. 04 Apr, 2024 6 commits
  3. 03 Apr, 2024 3 commits
  4. 02 Apr, 2024 28 commits