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):
<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"/>
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
- <field name="active" invisible="1" readonly="1"/>
</form>
</field>
</record>