[IMP]: add reporting fields to the account.account.type
bzr revid: mga@tinyerp.com-20100512120237-zhpdub7nxts3g8s0
This commit is contained in:
parent
ed311920d2
commit
f4685de2b8
|
@ -122,6 +122,16 @@ class account_account_type(osv.osv):
|
|||
'partner_account': fields.boolean('Partner account'),
|
||||
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
|
||||
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
|
||||
'report_type':fields.selection([
|
||||
('none','/'),
|
||||
('income','Profilt & Loss (Income Accounts)'),
|
||||
('expanse','Profilt & Loss (Expanse Accounts)'),
|
||||
('asset','Balance Sheet (Assets Accounts)'),
|
||||
('liabilities','Balance Sheet (Liabilities Accounts)')
|
||||
],'Type Heads', select=True, readonly=False, help="According value related accounts will be display on respective reports (Balance Sheet Profit & Loss Account)"),
|
||||
'parent_id':fields.many2one('account.account.type', 'Parent Type', required=False),
|
||||
'child_ids':fields.one2many('account.account.type', 'parent_id', 'Child Types', required=False),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_defaults = {
|
||||
'close_method': lambda *a: 'none',
|
||||
|
@ -129,6 +139,15 @@ class account_account_type(osv.osv):
|
|||
'sign': lambda *a: 1,
|
||||
}
|
||||
_order = "sequence"
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
#TODO: Need to check for recusrion
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive types.', ['parent_id'])
|
||||
]
|
||||
|
||||
account_account_type()
|
||||
|
||||
def _code_get(self, cr, uid, context={}):
|
||||
|
|
|
@ -467,12 +467,24 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Type">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<field name="sign"/>
|
||||
<field name="close_method"/>
|
||||
<field name="partner_account"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1" colspan="4"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="partner_account"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Reporting Configuration" colspan="4"/>
|
||||
<field name="report_type" select="2"/>
|
||||
<field name="sign"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Closing Method" colspan="4"/>
|
||||
<field name="close_method"/>
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue