Enforce the usage of account kind
issue2475 review295005
This commit is contained in:
+4
-4
@@ -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
@@ -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={
|
||||
|
||||
@@ -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')])
|
||||
|
||||
Reference in New Issue
Block a user