<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/openerp/tools/float_utils.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[REF] openerp: move `openerp` to `odoo`</title>
<updated>2016-09-02T15:28:12+00:00</updated>
<author>
<name>Raphael Collet</name>
<email>rco@openerp.com</email>
</author>
<published>2016-09-02T13:58:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9e64f9f9514194d74e166b032add8511182f2677'/>
<id>9e64f9f9514194d74e166b032add8511182f2677</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] fields: do not serialize more digits than necessary in `monetary._symbol_set()`</title>
<updated>2016-06-23T08:08:57+00:00</updated>
<author>
<name>Raphael Collet</name>
<email>rco@openerp.com</email>
</author>
<published>2016-06-22T14:06:09+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1ba91042d673cde921f9d47884866db6f9174b7d'/>
<id>1ba91042d673cde921f9d47884866db6f9174b7d</id>
<content type='text'>
Add a class for float objects that carry their precision digits, use it for the
value of monetary fields in record cache, and serialize them as expected for
the database.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a class for float objects that carry their precision digits, use it for the
value of monetary fields in record cache, and serialize them as expected for
the database.
</pre>
</div>
</content>
</entry>
<entry>
<title>[LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text</title>
<updated>2015-06-02T01:16:04+00:00</updated>
<author>
<name>Olivier Dony</name>
<email>odo@openerp.com</email>
</author>
<published>2015-06-01T22:39:30+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0bd454534818941bc3216025ebe3dcac3d78c19d'/>
<id>0bd454534818941bc3216025ebe3dcac3d78c19d</id>
<content type='text'>
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: support float rounding with rounding_method=UP (ceiling)</title>
<updated>2014-10-22T12:28:22+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@openerp.com</email>
</author>
<published>2014-10-08T14:10:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7705f883d23b71cdb1d30300ce69d9df665ae55e'/>
<id>7705f883d23b71cdb1d30300ce69d9df665ae55e</id>
<content type='text'>
Add rounding_method parameter on float_round method to offer
HALF-UP (default, usual round) or UP (ceiling) rounding method.
Use the second method instead of math.ceil() for product
reservations.

For UP, the python math.ceil() method uses "torwards infinity"
rounding method while we want "away from zero".
Therefore we use the absolute value of normalized_value to make
sure than -1.8 is rounded to -2.0 and not -1.

Fixes #1125 #2793

This is a cherry-pick of d4972ff which was reverted at 333852e due
to remaining issue with negative values.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add rounding_method parameter on float_round method to offer
HALF-UP (default, usual round) or UP (ceiling) rounding method.
Use the second method instead of math.ceil() for product
reservations.

For UP, the python math.ceil() method uses "torwards infinity"
rounding method while we want "away from zero".
Therefore we use the absolute value of normalized_value to make
sure than -1.8 is rounded to -2.0 and not -1.

Fixes #1125 #2793

This is a cherry-pick of d4972ff which was reverted at 333852e due
to remaining issue with negative values.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP"</title>
<updated>2014-09-26T19:21:06+00:00</updated>
<author>
<name>Denis Ledoux</name>
<email>dle@odoo.com</email>
</author>
<published>2014-09-26T19:21:06+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=333852e19dd3d5174e07e29f9d8f6c087b2c09f6'/>
<id>333852e19dd3d5174e07e29f9d8f6c087b2c09f6</id>
<content type='text'>
This reverts commit d4972ffdb6b9356a524eef1dbc11f455ff4473f2.

Seems to break some cases, at least in _product_reserve from stock/stock.py

Actual use case:

SELECT product_uom, sum(product_qty) AS product_qty FROM stock_move WHERE location_dest_id=%s AND location_id&lt;&gt;%s AND product_id=3645 AND state='done' GROUP BY product_uom;
returning 1 | 6

SELECT product_uom,-sum(product_qty) AS product_qty FROM stock_move WHERE location_id=%s AND location_dest_id&lt;&gt;%s AND product_id=%s AND state in ('done', 'assigned') GROUP BY product_uom;
returning 1 | -6

results += cr.dictfetchall()
    total = 0.0
    results2 = 0.0
    for r in results:
        amount = uom_obj._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
        results2 += amount
        total += amount
Total = 1, amount = -5

It should actually be
Total = 0, amount = -6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d4972ffdb6b9356a524eef1dbc11f455ff4473f2.

Seems to break some cases, at least in _product_reserve from stock/stock.py

Actual use case:

SELECT product_uom, sum(product_qty) AS product_qty FROM stock_move WHERE location_dest_id=%s AND location_id&lt;&gt;%s AND product_id=3645 AND state='done' GROUP BY product_uom;
returning 1 | 6

SELECT product_uom,-sum(product_qty) AS product_qty FROM stock_move WHERE location_id=%s AND location_dest_id&lt;&gt;%s AND product_id=%s AND state in ('done', 'assigned') GROUP BY product_uom;
returning 1 | -6

results += cr.dictfetchall()
    total = 0.0
    results2 = 0.0
    for r in results:
        amount = uom_obj._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
        results2 += amount
        total += amount
Total = 1, amount = -5

It should actually be
Total = 0, amount = -6
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP</title>
<updated>2014-09-24T15:11:25+00:00</updated>
<author>
<name>Cedric Snauwaert</name>
<email>csn@openerp.com</email>
</author>
<published>2014-09-23T15:39:14+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d4972ffdb6b9356a524eef1dbc11f455ff4473f2'/>
<id>d4972ffdb6b9356a524eef1dbc11f455ff4473f2</id>
<content type='text'>
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] float_utils: simplified code, added float_repr</title>
<updated>2011-12-20T23:47:40+00:00</updated>
<author>
<name>Olivier Dony</name>
<email>odo@openerp.com</email>
</author>
<published>2011-12-20T23:47:40+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=759ccd984542ce4077dfcc9fa14198b60719dded'/>
<id>759ccd984542ce4077dfcc9fa14198b60719dded</id>
<content type='text'>
lp bug: https://launchpad.net/bugs/882036 fixed

bzr revid: odo@openerp.com-20111220234740-kotcgoz3opcbkx4b</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lp bug: https://launchpad.net/bugs/882036 fixed

bzr revid: odo@openerp.com-20111220234740-kotcgoz3opcbkx4b</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] float_utils: fix HALF_UP rounding according to discussions on bug 882036</title>
<updated>2011-12-20T16:34:20+00:00</updated>
<author>
<name>Olivier Dony</name>
<email>odo@openerp.com</email>
</author>
<published>2011-12-20T16:34:20+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ed53ef476137c707245e3ef50ab800f31de58aeb'/>
<id>ed53ef476137c707245e3ef50ab800f31de58aeb</id>
<content type='text'>
Also improved test and added warning logging when
crossing the precision limit due to too many
significant digits. There is apparently a limitation
in Python's float implementation for this.

bzr revid: odo@openerp.com-20111220163420-lz0sh1h0yjkh6jdc</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also improved test and added warning logging when
crossing the precision limit due to too many
significant digits. There is apparently a limitation
in Python's float implementation for this.

bzr revid: odo@openerp.com-20111220163420-lz0sh1h0yjkh6jdc</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] float_utils: better variable names, explain /epsilon/ usage</title>
<updated>2011-12-19T10:57:18+00:00</updated>
<author>
<name>Olivier Dony</name>
<email>odo@openerp.com</email>
</author>
<published>2011-12-19T10:57:18+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=dcd1c1daff6e27b26c76cb222fc8ca05b98aaae4'/>
<id>dcd1c1daff6e27b26c76cb222fc8ca05b98aaae4</id>
<content type='text'>
bzr revid: odo@openerp.com-20111219105718-0jbz01rirl0s64ca</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bzr revid: odo@openerp.com-20111219105718-0jbz01rirl0s64ca</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] float_utils: moved in its own python module</title>
<updated>2011-12-16T16:04:26+00:00</updated>
<author>
<name>Olivier Dony</name>
<email>odo@openerp.com</email>
</author>
<published>2011-12-16T16:04:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9ddd05fb3ae83a6517b667009d34ab1826582cb7'/>
<id>9ddd05fb3ae83a6517b667009d34ab1826582cb7</id>
<content type='text'>
bzr revid: odo@openerp.com-20111216160426-gya8d1d1zymcz8os</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bzr revid: odo@openerp.com-20111216160426-gya8d1d1zymcz8os</pre>
</div>
</content>
</entry>
</feed>
