Skip to content
Snippets Groups Projects
Commit 3d97bddb authored by Fabien Pinckaers's avatar Fabien Pinckaers
Browse files

fix

bzr revid: fp@tinyerp.com-20110924112529-o72j8k1lota6sm1s
parent a583b076
No related branches found
No related tags found
No related merge requests found
......@@ -479,6 +479,7 @@ class sale_order(osv.osv):
picking_obj = self.pool.get('stock.picking')
invoice = self.pool.get('account.invoice')
obj_sale_order_line = self.pool.get('sale.order.line')
partner_currency = {}
if context is None:
context = {}
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
......@@ -486,6 +487,13 @@ class sale_order(osv.osv):
if date_inv:
context['date_inv'] = date_inv
for o in self.browse(cr, uid, ids, context=context):
currency_id = o.pricelist_id.currency_id.id
if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id):
raise osv.except_osv(
_('Error !'),
_('You cannot group sales having different currencies for the same partner.'))
partner_currency[o.partner_id.id] = currency_id
lines = []
for line in o.order_line:
if line.invoiced:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment