From e183f98ad1604bc1cd8a1842f10bd855cc366e9a Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Mon, 17 Jan 2011 17:59:44 +0100
Subject: [PATCH] [FIX] stock: fixed the type of account on
valuation_in_account_id and valuation_out_account_id and fixed its label too.
Also, improved the form view of stock.location for these 2 fields
bzr revid: qdp-launchpad@tinyerp.com-20110117165944-g50z4f6trn3qfit3
---
addons/stock/stock.py | 5 ++---
addons/stock/stock_view.xml | 5 +++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index a946c62752c..2e538e5d8e6 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -208,8 +208,8 @@ class stock_location(osv.osv):
'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock", digits_compute=dp.get_precision('Account')),
'company_id': fields.many2one('res.company', 'Company', select=1, help='Let this field empty if this location is shared between all companies'),
'scrap_location': fields.boolean('Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'),
- 'valuation_in_account_id': fields.many2one('account.account', 'Valuation In Account',domain = [('type','=','regular')], help='This account will be used for incoming move for this location, instead of account from Product variation account.'),
- 'valuation_out_account_id': fields.many2one('account.account', 'Valuation Out Account',domain = [('type','=','regular')], help='This account will be used for outgoing move for this location, instead of account from Product variation account.'),
+ 'valuation_in_account_id': fields.many2one('account.account', 'Stock Input Account',domain = [('type','=','other')], help='This account will be used to value stock moves that have this location as destination, instead of the stock output account from the product.'),
+ 'valuation_out_account_id': fields.many2one('account.account', 'Stock Output Account',domain = [('type','=','other')], help='This account will be used ta value stock moves that have this location as source, instead of the stock input account from the product.'),
}
_defaults = {
'active': True,
@@ -2018,7 +2018,6 @@ class stock_move(osv.osv):
if not acc_variation:
raise osv.except_osv(_('Error!'), _('There is no inventory variation account defined on the product category: "%s" (id: %d)') % \
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
-
return journal_id, acc_src, acc_dest, acc_variation
def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 4ba65baba1b..4a972185afd 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -493,8 +493,6 @@
-
-
@@ -503,6 +501,9 @@
+
+
+