From 42c89ee0cb07e2c1bc806d6f4c5d639f9a520ba3 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 17 Jan 2011 15:55:22 +0530 Subject: [PATCH 1/2] [FIX] project, analytic: Template project shouldn't pollute the analytic chart of account. lp bug: https://launchpad.net/bugs/681463 fixed bzr revid: uco@tinyerp.com-20110117102522-9xpds30ckjny7l9p --- addons/account/project/project_view.xml | 2 +- addons/analytic/analytic.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 77e03c23700..46867c8bf23 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -53,7 +53,7 @@ account.analytic.account.tree account.analytic.account tree - child_ids + child_complete_ids diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 03e9a9608cd..4428ba4e9be 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -109,6 +109,20 @@ class account_analytic_account(osv.osv): def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = self.name_get(cr, uid, ids) return dict(res) + + def _child_compute(self, cr, uid, ids, name, arg, context=None): + result = {} + if context is None: + context = {} + + for account in self.browse(cr, uid, ids, context=context): + for child in account.child_ids: + if child.state == 'template': + account.child_ids.pop(account.child_ids.index(child)) + result[account.id] = map(lambda x: x.id, account.child_ids) + + return result + _columns = { 'name': fields.char('Account Name', size=128, required=True), @@ -118,6 +132,7 @@ class account_analytic_account(osv.osv): 'description': fields.text('Description'), 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2), 'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'), + 'child_complete_ids': fields.function(_child_compute, relation='account.analytic.account', method=True, string="Account Hierarchy", type='many2many'), 'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'), 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), 'debit': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), From ae410f8dd32a6b4447e99d1d4d4e83ac4b57119e Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 17 Jan 2011 16:08:28 +0530 Subject: [PATCH 2/2] [FIX] crm: Added exrule field in the view for recurrency with exception rules. lp bug: https://launchpad.net/bugs/530681 fixed bzr revid: uco@tinyerp.com-20110117103828-31f8bdxb3n9rr81i --- addons/crm/crm_meeting_view.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index ae9f584d059..e9f412b63dd 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -182,7 +182,9 @@ - + + +