openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #02095
[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3
ARA(OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
Requested reviews:
OpenERP R&D Team (openerp-dev)
Related bugs:
#615522 Report Of Invoice : Payment Term + Due date not printed
https://bugs.launchpad.net/bugs/615522
#649029 [sale] incoterm field poorly implemented [direct sql / not translatable]
https://bugs.launchpad.net/bugs/649029
#656378 [trunk] general ledger -
https://bugs.launchpad.net/bugs/656378
#672553 opening entries from chart of account doesn't use context
https://bugs.launchpad.net/bugs/672553
#674480 [6.0 RC2] incorrect creation of Accounting Journals is some localizations prevents multiple charts from being installed
https://bugs.launchpad.net/bugs/674480
#675494 [Trunk] - If you delete an invoice entry, invoice still exists
https://bugs.launchpad.net/bugs/675494
#681398 sale access right
https://bugs.launchpad.net/bugs/681398
#689536 [6.0] partner layout salesman/salesteam issue
https://bugs.launchpad.net/bugs/689536
#690326 [6.0RC1] View mode "tree,form,search" in several window actions
https://bugs.launchpad.net/bugs/690326
#690753 [6.0] and [5.x] account_analytic_line must not be deleted if the journal etc is deleted
https://bugs.launchpad.net/bugs/690753
#691072 [6.0RC1][TRUNK][account_voucher] Wrong definition of field 'company_id' in 'account_voucher_line' object
https://bugs.launchpad.net/bugs/691072
#692986 [6.0] hr_payroll_account hr_payroll_account_view.xml - required fields block opening form
https://bugs.launchpad.net/bugs/692986
#694833 Salary Structure deduction percentage limitation
https://bugs.launchpad.net/bugs/694833
#696914 [6.0 RC2] account bank statement - usability
https://bugs.launchpad.net/bugs/696914
#697673 Wrong column title in timesheet view
https://bugs.launchpad.net/bugs/697673
#697989 Failed to install module multi_company
https://bugs.launchpad.net/bugs/697989
For more details, see:
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-ara/+merge/45665
Hello,
Account: Add constraint on account.account and account.account.template for type and related changes in demo data.
Thanks,
ara
--
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-ara/+merge/45665
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account/account.py'
--- account/account.py 2011-01-06 11:32:21 +0000
+++ account/account.py 2011-01-10 09:01:23 +0000
@@ -397,7 +397,13 @@
'currency_mode': 'current',
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
}
-
+ def _check_type(self, cr, uid, ids, context=None):
+ type = self.browse(cr, uid, ids, context=context)
+ for t in type:
+ if t.type != 'view' and t.parent_id:
+ return False
+ return True
+
def _check_recursion(self, cr, uid, ids, context=None):
obj_self = self.browse(cr, uid, ids[0], context=context)
p_id = obj_self.parent_id and obj_self.parent_id.id
@@ -420,7 +426,8 @@
return True
_constraints = [
- (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id'])
+ (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']),
+ (_check_type, 'Error ! You can not create child account as Receivable, Payable, Consolidation, Liquidity, Regular and Closed type.', ['type']),
]
_sql_constraints = [
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
@@ -2295,9 +2302,17 @@
'nocreate': False,
}
+ def _check_type(self, cr, uid, ids, context=None):
+ type = self.browse(cr, uid, ids, context=context)
+ for t in type:
+ if t.type != 'view' and t.parent_id:
+ return False
+ return True
+
_check_recursion = check_cycle
_constraints = [
- (_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id'])
+ (_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id']),
+ (_check_type, 'Error ! You can not create child template as Receivable, Payable, Consolidation, Liquidity, Regular and Closed type.', ['type']),
]
=== modified file 'account/demo/account_minimal.xml'
--- account/demo/account_minimal.xml 2011-01-03 09:08:25 +0000
+++ account/demo/account_minimal.xml 2011-01-10 09:01:23 +0000
@@ -102,7 +102,7 @@
<field name="code">X1000</field>
<field name="name">Fixed Asset Account - (test)</field>
<field ref="fas" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@@ -126,7 +126,7 @@
<field name="code">X11001</field>
<field name="name">Purchased Stocks - (test)</field>
<field ref="cas" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@@ -134,7 +134,7 @@
<field name="code">X11002</field>
<field name="name">Debtors - (test)</field>
<field ref="cas" name="parent_id"/>
- <field name="type">receivable</field>
+ <field name="type">view</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_receivable"/>
</record>
@@ -143,7 +143,7 @@
<field name="code">X11003</field>
<field name="name">Output VAT - (test)</field>
<field ref="cas" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@@ -151,7 +151,7 @@
<field name="code">X11004</field>
<field name="name">Bank Current Account - (test)</field>
<field ref="cas" name="parent_id"/>
- <field name="type">liquidity</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@@ -159,7 +159,7 @@
<field name="code">X11005</field>
<field name="name">Cash - (test)</field>
<field ref="cas" name="parent_id"/>
- <field name="type">liquidity</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@@ -184,7 +184,7 @@
<field name="code">X1111</field>
<field name="name">Creditors - (test)</field>
<field ref="cli" name="parent_id"/>
- <field name="type">payable</field>
+ <field name="type">view</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_payable"/>
</record>
@@ -193,7 +193,7 @@
<field name="code">X1112</field>
<field name="name">Input VAT - (test)</field>
<field ref="cli" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_liability"/>
</record>
@@ -201,7 +201,7 @@
<field name="code">X1113</field>
<field name="name">Reserve and Profit/Loss - (test)</field>
<field ref="cli" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_liability"/>
</record>
@@ -227,7 +227,7 @@
<record model="account.account" id="income_fx_income">
<field name="name">Foreign Exchange Gain - (test)</field>
<field name="code">X201</field>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_income"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="income_view"/>
@@ -245,7 +245,7 @@
<field name="code">X2001</field>
<field name="name">Product Sales - (test)</field>
<field ref="rev" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_income"/>
</record>
@@ -271,7 +271,7 @@
<field name="code">X2100</field>
<field name="name">Cost of Goods Sold - (test)</field>
<field ref="cos" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_expense"/>
</record>
@@ -287,14 +287,14 @@
<field name="code">X2110</field>
<field name="name">Expenses - (test)</field>
<field ref="ovr" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record model="account.account" id="income_fx_expense">
<field name="name">Foreign Exchange Loss - (test)</field>
<field name="code">X2111</field>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_expense"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="ovr"/>
@@ -304,7 +304,7 @@
<field name="code">X2112</field>
<field name="name">Salary Expenses - (test)</field>
<field ref="ovr" name="parent_id"/>
- <field name="type">other</field>
+ <field name="type">view</field>
<field name="user_type" ref="account_type_expense"/>
</record>