From 4fb497b65302a0350eda4f975627aa4e43ec9ef3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 26 May 2015 16:26:48 +0200 Subject: [PATCH] [FIX] stock_account: invoice journal type for transit locations When using locations of 'transit' type in pickings, the invoice journal type was always set to "Sales", while, for instance, for an incoming shipment, with as source location a transit location, the invoice journal should obviously be purchase opw-639536 --- addons/stock_account/wizard/stock_invoice_onshipping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock_account/wizard/stock_invoice_onshipping.py b/addons/stock_account/wizard/stock_invoice_onshipping.py index 63a827ca3cf..cae3af5eae8 100644 --- a/addons/stock_account/wizard/stock_invoice_onshipping.py +++ b/addons/stock_account/wizard/stock_invoice_onshipping.py @@ -42,13 +42,13 @@ class stock_invoice_onshipping(osv.osv_memory): src_usage = pick.move_lines[0].location_id.usage dest_usage = pick.move_lines[0].location_dest_id.usage type = pick.picking_type_id.code - if type == 'outgoing' and dest_usage == 'supplier': + if type == 'outgoing' and dest_usage in ('supplier', 'transit'): journal_type = 'purchase_refund' - elif type == 'outgoing' and dest_usage == 'customer': + elif type == 'outgoing' and dest_usage in ('customer', 'transit'): journal_type = 'sale' - elif type == 'incoming' and src_usage == 'supplier': + elif type == 'incoming' and src_usage in ('supplier', 'transit'): journal_type = 'purchase' - elif type == 'incoming' and src_usage == 'customer': + elif type == 'incoming' and src_usage in ('customer', 'transit'): journal_type = 'sale_refund' else: journal_type = 'sale'