[MERGE] forward port of branch 7.0 up to 3a0af6a
authorDenis Ledoux <dle@odoo.com>
Wed, 22 Oct 2014 17:26:27 +0000 (19:26 +0200)
committerDenis Ledoux <dle@odoo.com>
Wed, 22 Oct 2014 17:26:27 +0000 (19:26 +0200)
1  2 
addons/product/product.py
addons/product/product_view.xml
openerp/addons/base/test/base_test.yml
openerp/osv/orm.py
openerp/report/render/rml2pdf/trml2pdf.py

@@@ -129,15 -129,15 +129,15 @@@ class product_uom(osv.osv)
  
      _order = "name"
      _columns = {
 -        'name': fields.char('Unit of Measure', size=64, required=True, translate=True),
 +        'name': fields.char('Unit of Measure', required=True, translate=True),
          'category_id': fields.many2one('product.uom.categ', 'Category', required=True, ondelete='cascade',
              help="Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."),
-         'factor': fields.float('Ratio', required=True,digits=(12, 12),
+         'factor': fields.float('Ratio', required=True, digits=0, # force NUMERIC with unlimited precision
              help='How much bigger or smaller this unit is compared to the reference Unit of Measure for this category:\n'\
                      '1 * (reference unit) = ratio * (this unit)'),
-         'factor_inv': fields.function(_factor_inv, digits=(12,12),
+         'factor_inv': fields.function(_factor_inv, digits=0, # force NUMERIC with unlimited precision
              fnct_inv=_factor_inv_write,
 -            string='Ratio',
 +            string='Bigger Ratio',
              help='How many times this Unit of Measure is bigger than the reference Unit of Measure in this category:\n'\
                      '1 * (this unit) = ratio * (reference unit)', required=True),
          'rounding': fields.float('Rounding Precision', digits_compute=dp.get_precision('Product Unit of Measure'), required=True,
Simple merge
      "Float precision tests: verify that float rounding methods are working correctly via tools"
  -
      !python {model: res.currency}: |
 -        from tools import float_compare, float_is_zero, float_round, float_repr
 -        def try_round(amount, expected, precision_digits=3, float_round=float_round, float_repr=float_repr, rounding_method='HALF-UP'):
 +        from openerp.tools import float_compare, float_is_zero, float_round, float_repr
 +        def try_round(amount, expected, precision_digits=3, float_round=float_round, float_repr=float_repr):
-             result = float_repr(float_round(amount, precision_digits=precision_digits),
-                                 precision_digits=precision_digits)
+             result = float_repr(float_round(amount, precision_digits=precision_digits, rounding_method=rounding_method),
 -                                precision_digits=precision_digits)
              assert result == expected, 'Rounding error: got %s, expected %s' % (result, expected)
          try_round(2.6745, '2.675')
          try_round(-2.6745, '-2.675')
Simple merge