Enforce the usage of account kind

issue2475
review295005
This commit is contained in:
Cédric Krier
2012-03-30 14:21:05 +02:00
parent 2088eae140
commit c8be246f07
3 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -41,7 +41,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="reconcile" eval="True"/>
<field name="deferral" eval="True"/>
<field name="parent" ref="account.account_template_root"/>
<field name="kind">other</field>
<field name="kind">stock</field>
</record>
<record model="account.account.template" id="account_template_stock_supplier">
@@ -50,7 +50,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="reconcile" eval="True"/>
<field name="deferral" eval="True"/>
<field name="parent" ref="account.account_template_root"/>
<field name="kind">other</field>
<field name="kind">stock</field>
</record>
<record model="account.account.template" id="account_template_stock_customer">
@@ -59,7 +59,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="reconcile" eval="True"/>
<field name="deferral" eval="True"/>
<field name="parent" ref="account.account_template_root"/>
<field name="kind">other</field>
<field name="kind">stock</field>
</record>
<record model="account.account.template" id="account_template_stock_lost_found">
@@ -68,7 +68,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="reconcile" eval="True"/>
<field name="deferral" eval="True"/>
<field name="parent" ref="account.account_template_root"/>
<field name="kind">other</field>
<field name="kind">stock</field>
</record>
</data>
+8 -8
View File
@@ -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={
+1 -1
View File
@@ -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')])