[FIX] stock_landed_costs: stock input account

When assigning landed costs to products that have already left the
stock, the expense account is used instead of the stock input account.

opw-671311
This commit is contained in:
Nicolas Martinelli 2016-03-07 17:02:19 +01:00
parent 7cf20afb0b
commit b955bac100
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class stock_landed_cost(osv.osv):
accounts = product_obj.get_product_accounts(cr, uid, line.product_id.product_tmpl_id.id, context=context)
debit_account_id = accounts['property_stock_valuation_account_id']
already_out_account_id = accounts['stock_account_output']
credit_account_id = line.cost_line_id.account_id.id or cost_product.property_account_expense.id or cost_product.categ_id.property_account_expense_categ.id
credit_account_id = accounts['stock_account_input']
if not credit_account_id:
raise osv.except_osv(_('Error!'), _('Please configure Stock Expense Account for product: %s.') % (cost_product.name))