[FIX] pos: [wizard: pos_payment] When you create invoices with different currencies set, the price is well mapped, but with the wrong currency

lp bug: https://launchpad.net/bugs/710462 fixed

bzr revid: mra@mra-laptop-20110203105528-0pe8uzhg0brgib58
This commit is contained in:
Mustufa Rangwala 2011-02-03 16:25:28 +05:30
parent 8c316dca64
commit eff87b20ec
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -88,7 +88,7 @@
</group>
<group colspan="4">
<field name="sale_journal" domain="[('type','=','sale')]" widget="selection" invisible="1"/>
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection" invisible="1"/>
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection" invisible="0"/>
</group>
</page>
<page string="Notes" >