account: remove exception when inactive account with entries

bzr revid: ced-414daff2fea67fa3fbe4601ce84aa32d468a57d3
This commit is contained in:
ced 2007-08-01 14:03:45 +00:00
parent 21e2436edc
commit b250eb70df
2 changed files with 4 additions and 3 deletions

View File

@ -321,8 +321,9 @@ class account_account(osv.osv):
if 'active' in vals and not vals['active']:
line_obj = self.pool.get('account.move.line')
if line_obj.search(cr, uid, [('account_id', 'in', ids)]):
raise osv.except_osv('Error!', 'You can not deactivate a account with entry lines!')
super(account_account, self).write(cr, uid, ids, vals, context=context)
vals=vals.copy()
del vals['active']
return super(account_account, self).write(cr, uid, ids, vals, context=context)
account_account()
class account_journal_view(osv.osv):

View File

@ -113,6 +113,7 @@
<page string="General Information">
<field name="name" select="1" colspan="4"/>
<field name="company_id" select="2"/>
<field name="active"/>
<newline/>
<field name="type" select="1"/>
<field name="code" select="1"/>
@ -129,7 +130,6 @@
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
<field name="active" invisible="1" readonly="1"/>
</form>
</field>
</record>