From e588d85315968f48c98e96b23f4153ee93d950d3 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 2 May 2016 13:16:09 +0200 Subject: [PATCH 1/2] [FIX] product_expiry: 'product_id' in context When creating a new lot from an incoming picking transfer, the product_id is written in the context. opw:674608 --- addons/product_expiry/product_expiry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py index d24640f85ed..104b938c67c 100644 --- a/addons/product_expiry/product_expiry.py +++ b/addons/product_expiry/product_expiry.py @@ -58,7 +58,7 @@ class stock_production_lot(osv.osv): # Assign dates according to products data def create(self, cr, uid, vals, context=None): context = dict(context or {}) - context['product_id'] = vals.get('product_id', context.get('default_product_id')) + context['product_id'] = vals.get('product_id', context.get('default_product_id') or context.get('product_id')) return super(stock_production_lot, self).create(cr, uid, vals, context=context) _defaults = { From e664d3074ce478fb0a79db419d6693cc0edc34fb Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 4 May 2016 11:31:20 +0200 Subject: [PATCH 2/2] [FIX] account: A negative amount with sale taxes on bank statement line must be considered as a refund. Courtesy of Adrien Peiffer (ACSONE). PR #11877 --- addons/account/account_move_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a698b263e44..2ace8acc7ee 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1378,7 +1378,8 @@ class account_move_line(osv.osv): account_id = 'account_collected_id' base_sign = 'base_sign' tax_sign = 'tax_sign' - if journal.type in ('purchase_refund', 'sale_refund') or (journal.type in ('cash', 'bank') and total < 0 and tax_id.type_tax_use != 'sale'): + is_refund = ((total > 0 and tax_id.type_tax_use == 'sale') or (total < 0 and tax_id.type_tax_use != 'sale')) + if journal.type in ('purchase_refund', 'sale_refund') or (journal.type in ('cash', 'bank') and is_refund): base_code = 'ref_base_code_id' tax_code = 'ref_tax_code_id' account_id = 'account_paid_id'