From 5f696ff6e4ba0ea284b58234b93141a8d1b6eec8 Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 10 Sep 2008 12:33:13 +0200 Subject: [PATCH] *set the user_type field on account_account and account_account_template as mandatory *removed deprecated type from account_account_template *corrected minimal chart of account: moved account_account_type into the demo data + modified it in order to have something that makes more sense bzr revid: qdp@tinyerp.com-20080910103313-1ed33vgw5z5q25n2 --- addons/account/account.py | 12 +++---- addons/account/data/account_minimal.xml | 47 +++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 652e74b9acd..42824d42446 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -51,6 +51,7 @@ class account_payment_term(osv.osv): 'active': lambda *a: 1, } _order = "name" + def compute(self, cr, uid, id, value, date_ref=False, context={}): if not date_ref: date_ref = now().strftime('%Y-%m-%d') @@ -225,7 +226,7 @@ class account_account(osv.osv): ('closed','Closed'), ], 'Internal Type', required=True,), - 'user_type': fields.many2one('account.account.type', 'Account Type'), + 'user_type': fields.many2one('account.account.type', 'Account Type', required=True), 'parent_id': fields.many2one('account.account','Parent', ondelete='cascade'), 'child_parent_ids':fields.one2many('account.account','parent_id','Children'), 'child_consol_ids':fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children',domain=[('type', '=', 'consolidation')]), @@ -1647,15 +1648,10 @@ class account_account_template(osv.osv): ('payable','Payable'), ('view','View'), ('consolidation','Consolidation'), - ('income','Income'), - ('expense','Expense'), - ('tax','Tax'), - ('cash','Cash'), - ('asset','Asset'), - ('equity','Equity'), + ('other','Others'), ('closed','Closed'), ], 'Internal Type', required=True,), - 'user_type': fields.many2one('account.account.type', 'Account Type'), + 'user_type': fields.many2one('account.account.type', 'Account Type', required=True), 'reconcile': fields.boolean('Allow Reconciliation', help="Check this option if the user can make a reconciliation of the entries in this account."), 'shortcut': fields.char('Shortcut', size=12), 'note': fields.text('Note'), diff --git a/addons/account/data/account_minimal.xml b/addons/account/data/account_minimal.xml index 69d79e3f228..a84cd53f34f 100644 --- a/addons/account/data/account_minimal.xml +++ b/addons/account/data/account_minimal.xml @@ -2,6 +2,44 @@ + + + + View + view + none + + + Asset + asset + balance + + + Liability + liability + balance + + + Income + income + none + + + Expense + expense + none + + + Cash + cash + balance + + + x 0 Chart For Automated Tests @@ -13,8 +51,8 @@ only if you selected demo data during your database creation. Modules can do black box testing on entries on this chart of account, without modifying your own accounts. + - Main Receivable x 40000 @@ -23,6 +61,7 @@ your own accounts. + This chart of account is used for automated testing purpose. It is installed only if you selected demo data during your database creation. Modules can @@ -38,6 +77,7 @@ your own chart of account. + This chart of account is used for automated testing purpose. It is installed only if you selected demo data during your database creation. Modules can @@ -45,7 +85,6 @@ do black box testing on entries on this chart of account, without modifying your own chart of account. - Petty Cash x 570000 @@ -53,6 +92,7 @@ your own chart of account. + This chart of account is used for automated testing purpose. It is installed only if you selected demo data during your database creation. Modules can @@ -60,7 +100,6 @@ do black box testing on entries on this chart of account, without modifying your own chart of account. - Products Purchase x 600000 @@ -68,6 +107,7 @@ your own chart of account. + This chart of account is used for automated testing purpose. It is installed only if you selected demo data during your database creation. Modules can @@ -81,6 +121,7 @@ your own chart of account. other + This chart of account is used for automated testing purpose. It is installed