Merge pull request #36 from akretion/8-fix-region

[8.0][FIX] Region on intrastat transaction lines
This commit is contained in:
Alexis de Lattre
2018-07-26 19:47:42 +02:00
committed by GitHub

View File

@@ -376,10 +376,10 @@ class IntrastatProductDeclaration(models.Model):
inv_type = inv_line.invoice_id.type
if inv_line.move_line_ids:
if inv_type in ('in_invoice', 'out_refund'):
region = inv_line.move_line_ids[0].location_id.\
region = inv_line.move_line_ids[0].location_dest_id.\
get_intrastat_region()
else:
region = inv_line.move_line_ids[0].location_dest_id.\
region = inv_line.move_line_ids[0].location_id.\
get_intrastat_region()
elif inv_type in ('in_invoice', 'in_refund'):
po_lines = self.env['purchase.order.line'].search(