[REM] Account: account type => remove parent id and child ids field from the object and view

bzr revid: mra@mra-laptop-20100921102448-ca97hku8wk53bfbr
This commit is contained in:
Mustufa Rangwala 2010-09-21 15:54:48 +05:30
parent caef1e8fbc
commit 0b6d6105ca
2 changed files with 6 additions and 16 deletions

View File

@ -157,8 +157,6 @@ class account_account_type(osv.osv):
('asset','Balance Sheet (Assets Accounts)'), ('asset','Balance Sheet (Assets Accounts)'),
('liability','Balance Sheet (Liability Accounts)') ('liability','Balance Sheet (Liability Accounts)')
],'Type Heads', select=True, readonly=False, help="According value related accounts will be display on respective reports (Balance Sheet Profit & Loss Account)"), ],'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'), 'note': fields.text('Description'),
} }
_defaults = { _defaults = {
@ -167,14 +165,6 @@ class account_account_type(osv.osv):
} }
_order = "code" _order = "code"
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() account_account_type()
def _code_get(self, cr, uid, context={}): def _code_get(self, cr, uid, context={}):
@ -690,23 +680,23 @@ class account_journal(osv.osv):
""" """
Returns a list of tupples containing id, name. Returns a list of tupples containing id, name.
result format : {[(id, name), (id, name), ...]} result format : {[(id, name), (id, name), ...]}
@param cr: A database cursor @param cr: A database cursor
@param user: ID of the user currently logged in @param user: ID of the user currently logged in
@param ids: list of ids for which name should be read @param ids: list of ids for which name should be read
@param context: context arguments, like lang, time zone @param context: context arguments, like lang, time zone
@return: Returns a list of tupples containing id, name @return: Returns a list of tupples containing id, name
""" """
result = self.browse(cr, user, ids, context) result = self.browse(cr, user, ids, context)
res = [] res = []
for rs in result: for rs in result:
name = rs.name name = rs.name
if rs.currency: if rs.currency:
name = "%s (%s)" % (rs.name, rs.currency.name) name = "%s (%s)" % (rs.name, rs.currency.name)
res += [(rs.id, name)] res += [(rs.id, name)]
return res return res
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args: if not args:
args = [] args = []
@ -2747,7 +2737,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
vals_journal['sequence_id'] = seq_id vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'cash' vals_journal['type'] = 'cash'
vals_journal['company_id'] = company_id vals_journal['company_id'] = company_id
if line.currency_id: if line.currency_id:
vals_journal['view_id'] = view_id_cur vals_journal['view_id'] = view_id_cur
vals_journal['currency'] = line.currency_id.id vals_journal['currency'] = line.currency_id.id

View File

@ -668,6 +668,7 @@
</tree> </tree>
</field> </field>
</record> </record>
<record id="view_account_type_form" model="ir.ui.view"> <record id="view_account_type_form" model="ir.ui.view">
<field name="name">account.account.type.form</field> <field name="name">account.account.type.form</field>
<field name="model">account.account.type</field> <field name="model">account.account.type</field>
@ -677,7 +678,6 @@
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="name" select="1"/> <field name="name" select="1"/>
<field name="code" select="1"/> <field name="code" select="1"/>
<field name="parent_id"/>
</group> </group>
<group col="2" colspan="2"> <group col="2" colspan="2">
<separator string="Reporting Configuration" colspan="4"/> <separator string="Reporting Configuration" colspan="4"/>