[MERGE] forward port of branch 7.0 up to 5f6d324
authorDenis Ledoux <dle@odoo.com>
Thu, 25 Sep 2014 13:10:37 +0000 (15:10 +0200)
committerDenis Ledoux <dle@odoo.com>
Thu, 25 Sep 2014 13:10:37 +0000 (15:10 +0200)
1  2 
addons/crm/crm_lead.py
addons/portal_sale/portal_sale_view.xml
addons/product/product.py
openerp/addons/base/test/base_test.yml

@@@ -622,7 -626,14 +622,14 @@@ class crm_lead(format_address, osv.osv)
                  attachment.write(values)
          return True
  
+     def _merge_opportunity_phonecalls(self, cr, uid, opportunity_id, opportunities, context=None):
+         phonecall_obj = self.pool['crm.phonecall']
+         for opportunity in opportunities:
+             for phonecall_id in phonecall_obj.search(cr, uid, [('opportunity_id', '=', opportunity.id)], context=context):
+                 phonecall_obj.write(cr, uid, phonecall_id, {'opportunity_id': opportunity_id}, context=context)
+         return True
 -    def merge_opportunity(self, cr, uid, ids, context=None):
 +    def merge_opportunity(self, cr, uid, ids, user_id=False, section_id=False, context=None):
          """
          Different cases of merge:
          - merge leads together = 1 new lead
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
 +        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),
+         def try_round(amount, expected, precision_digits=3, float_round=float_round, float_repr=float_repr, rounding_method='HALF-UP'):
+             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')