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
"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')