Repout Correct Dashbaord
bzr revid: fp@tinyerp.com-20080904162656-r2kpcvli4btr39or
This commit is contained in:
parent
977f609d4c
commit
98e61f2125
|
@ -243,13 +243,10 @@ class account_account(osv.osv):
|
|||
], 'Internal Type', required=True,),
|
||||
|
||||
'user_type': fields.many2one('account.account.type', 'Account Type'),
|
||||
# 'parent_id': fields.many2many('account.account', 'account_account_rel', 'child_id', 'parent_id', 'Parents'),
|
||||
'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')]),
|
||||
'child_id': fields.function(_get_child_ids, method=True, type='many2many',relation="account.account",string="Children Accounts"),
|
||||
|
||||
# 'child_id': fields.many2many('account.account', 'account_account_rel', 'parent_id', 'child_id', 'Children'),
|
||||
'balance': fields.function(__compute, digits=(16,2), method=True, string='Balance', multi='balance'),
|
||||
'credit': fields.function(__compute, digits=(16,2), method=True, string='Credit', multi='balance'),
|
||||
'debit': fields.function(__compute, digits=(16,2), method=True, string='Debit', multi='balance'),
|
||||
|
@ -279,23 +276,11 @@ class account_account(osv.osv):
|
|||
'active': lambda *a: True,
|
||||
}
|
||||
|
||||
# def _check_recursion(self, cr, uid, ids):
|
||||
# level = 100
|
||||
# while len(ids):
|
||||
# cr.execute('select distinct parent_id from account_account_rel where child_id in ('+','.join(map(str,ids))+')')
|
||||
# ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
# if not level:
|
||||
# return False
|
||||
# level -= 1
|
||||
# return True
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
obj_self=self.browse(cr,uid,ids[0])
|
||||
p_id=obj_self.parent_id and obj_self.parent_id.id
|
||||
|
||||
if (obj_self in obj_self.child_consol_ids) or (p_id and (p_id is obj_self.id)):
|
||||
return False
|
||||
|
||||
while(ids):
|
||||
cr.execute('select distinct child_id from account_account_consol_rel where parent_id in ('+','.join(map(str,ids))+')')
|
||||
child_ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
|
@ -310,7 +295,6 @@ class account_account(osv.osv):
|
|||
ids=child_ids
|
||||
return True
|
||||
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id'])
|
||||
]
|
||||
|
|
|
@ -54,23 +54,15 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="My Board">
|
||||
<hpaned>
|
||||
|
||||
<child1>
|
||||
|
||||
<action colspan="4" height="220" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
|
||||
|
||||
<action colspan="4" height="150" name="%(action_view_task_tree_deadline)d" string="My Deadlines"/>
|
||||
|
||||
<action colspan="4" height="150" name="%(action_view_board_note_tree)d" string="Public Notes"/>
|
||||
|
||||
</child1>
|
||||
|
||||
<!--<child2>-->
|
||||
<!-- <action colspan="4" name="%(report_analytic_planning.action_account_analytic_planning_stat_my_form)d" string="My Planning"/>-->
|
||||
<!-- -->
|
||||
<!-- <action colspan="4" name="%(report_timesheet.action_timesheet_user_stat_my)d" string="My Timesheet"/>-->
|
||||
<!-- -->
|
||||
<!--</child2>-->
|
||||
<child2>
|
||||
<action colspan="4" name="%(report_analytic_planning.action_account_analytic_planning_stat_my_form)d" string="My Planning"/>
|
||||
<action colspan="4" name="%(report_timesheet.action_timesheet_user_stat_my)d" string="My Timesheet"/>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -88,4 +80,4 @@
|
|||
<menuitem id="next_id_86" name="Project" parent="board.dashboard_menu"/><menuitem action="open_board_project" icon="terp-graph" id="menu_board_project" parent="next_id_86" sequence="1"/>
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
</terp>
|
||||
|
|
Loading…
Reference in New Issue