From c8be246f078a29778b9f844a7e415b3560ccb95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 30 Mar 2012 14:21:05 +0200 Subject: [PATCH] Enforce the usage of account kind issue2475 review295005 --- account.xml | 8 ++++---- product.py | 16 ++++++++-------- tests/scenario_account_stock_continental.rst | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/account.xml b/account.xml index 79297a0ce4..3817036ab0 100644 --- a/account.xml +++ b/account.xml @@ -41,7 +41,7 @@ this repository contains the full copyright notices and license terms. --> - other + stock @@ -50,7 +50,7 @@ this repository contains the full copyright notices and license terms. --> - other + stock @@ -59,7 +59,7 @@ this repository contains the full copyright notices and license terms. --> - other + stock @@ -68,7 +68,7 @@ this repository contains the full copyright notices and license terms. --> - other + stock diff --git a/product.py b/product.py index d9fff7dae8..5bec2bfe09 100644 --- a/product.py +++ b/product.py @@ -9,7 +9,7 @@ class Category(ModelSQL, ModelView): account_stock = fields.Property(fields.Many2One('account.account', 'Account Stock', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -19,7 +19,7 @@ class Category(ModelSQL, ModelView): depends=['account_parent'])) account_stock_supplier = fields.Property(fields.Many2One('account.account', 'Account Stock Supplier', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -29,7 +29,7 @@ class Category(ModelSQL, ModelView): depends=['account_parent'])) account_stock_customer = fields.Property(fields.Many2One('account.account', 'Account Stock Customer', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -39,7 +39,7 @@ class Category(ModelSQL, ModelView): depends=['account_parent'])) account_stock_lost_found = fields.Property(fields.Many2One( 'account.account', 'Account Stock Lost and Found', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -65,7 +65,7 @@ class Template(ModelSQL, ModelView): account_stock = fields.Property(fields.Many2One('account.account', 'Account Stock', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -80,7 +80,7 @@ class Template(ModelSQL, ModelView): account_stock_supplier = fields.Property(fields.Many2One('account.account', 'Account Stock Supplier', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -95,7 +95,7 @@ class Template(ModelSQL, ModelView): account_stock_customer = fields.Property(fields.Many2One('account.account', 'Account Stock Customer', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ @@ -110,7 +110,7 @@ class Template(ModelSQL, ModelView): account_stock_lost_found = fields.Property(fields.Many2One( 'account.account', 'Account Stock Lost and Found', domain=[ - ('kind', '!=', 'view'), + ('kind', '=', 'stock'), ('company', '=', Eval('context', {}).get('company', 0)), ], states={ diff --git a/tests/scenario_account_stock_continental.rst b/tests/scenario_account_stock_continental.rst index 5c8c0c1e12..89808b44e6 100644 --- a/tests/scenario_account_stock_continental.rst +++ b/tests/scenario_account_stock_continental.rst @@ -110,7 +110,7 @@ Create chart of accounts:: ... ('company', '=', company.id), ... ]) >>> stock, stock_supplier, stock_lost_found, stock_customer = Account.find([ - ... ('kind', '=', 'other'), + ... ('kind', '=', 'stock'), ... ('company', '=', company.id), ... ('name', 'like', 'Stock%'), ... ], order=[('name', 'ASC')])