From 780e3fec10e2f1f25a0d5530aad3d114249dcce7 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 13 May 2016 17:30:58 +0200 Subject: [PATCH] [FIX] l10n_be_intrastat: get location_id from stock move purchase.order have been rewritten with cb01be2 It was not taken into account for intrastat who still used the now not existing "location_id" on purchase order. This commit use instead the method _get_destination_location which should be equivalent. opw-677497 --- addons/l10n_be_intrastat/wizard/xml_decl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_be_intrastat/wizard/xml_decl.py b/addons/l10n_be_intrastat/wizard/xml_decl.py index 7779378bb1a..0b048c4aca4 100644 --- a/addons/l10n_be_intrastat/wizard/xml_decl.py +++ b/addons/l10n_be_intrastat/wizard/xml_decl.py @@ -230,9 +230,9 @@ class xml_decl(osv.TransientModel): poline_ids = POL.search( cr, uid, [('invoice_lines', 'in', inv_line.id)], context=context) if poline_ids: - purchaseorder = POL.browse(cr, uid, poline_ids[0], context=context).order_id + purchaseorder = POL.browse(cr, uid, poline_ids, context=context).order_id region_id = warehouse_mod.get_regionid_from_locationid( - cr, uid, purchaseorder.location_id.id, context=context) + cr, uid, purchaseorder._get_destination_location(), context=context) if region_id: exreg = region_mod.browse(cr, uid, region_id).code elif inv_line.invoice_id.type in ('out_invoice', 'out_refund'):