diff --git a/addons/account/account.py b/addons/account/account.py index d51f6f8cdfd..bcbf1b863a5 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -301,11 +301,10 @@ class account_account(osv.osv): for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) for child in current.child_id: - if sums.get(child.id, False): - if child.company_id.currency_id.id == current.company_id.currency_id.id: - sums[current.id][fn] += sums[child.id][fn] - else: - sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + if child.company_id.currency_id.id == current.company_id.currency_id.id: + sums[current.id][fn] += sums[child.id][fn] + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 8873ecf07e4..846c9e44514 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -70,6 +70,7 @@ class pos_order(osv.osv): return super(pos_order, self).unlink(cr, uid, ids, context=context) def onchange_partner_pricelist(self, cr, uid, ids, part=False, context=None): + """ Changed price list on_change of partner_id""" if not part: return {'value': {}} @@ -647,6 +648,7 @@ class pos_order(osv.osv): 'reference': order.name, 'partner_id': order.partner_id.id, 'comment': order.note or '', + 'currency_id': order.partner_id.property_product_pricelist.currency_id.id, # considering partner's sale pricelist's currency } inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'out_invoice', order.partner_id.id)['value']) if not inv.get('account_id', None): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 5bf85aba602..50108d26dad 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -88,7 +88,7 @@ - +