i experienced some problem when override method _amount_all(),
here the error:
TypeError: _amount_all() got an unexpected keyword argument 'context'
and here my code:
...
@api.multi
def _amount_all(self, field_name):
reslt = {}
result = super(sale_order, self)._amount_all(field_name)
for orders in self.browser(self.id):
reslt[orders.id] = {
'discount_fidelity': self.discount_fidelity
}
result[orders.id]['discount_fidelity'] = cur_obj.round(
reslt[orders.id]['discount_fidelity'])
result[orders.id]['amount_total'] = result[orders.id][
'amount_total'] - reslt[orders.id]['discount_fidelity']
return result
The point why i override this function because i want to add new field to use when counting total amount.
Thanks.