Onchange on asset account => fill the depreciation account
bzr revid: bde@tiny2-desktop-20110517064117-zz46iisjceas9hrd
This commit is contained in:
parent
a2ffcb5888
commit
0f3aa047a8
|
@ -43,6 +43,16 @@ class account_asset_category(osv.osv):
|
||||||
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'account.asset.category', context=context),
|
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'account.asset.category', context=context),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def onchange_account_depreciation_id(self, cr, uid, ids, account_asset_id, context=None):
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
|
account_depreciation_id = self.pool.get('account.account').browse(cr, uid, account_asset_id,
|
||||||
|
context=context).id
|
||||||
|
return {'value': {
|
||||||
|
'account_depreciation_id': account_depreciation_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
account_asset_category()
|
account_asset_category()
|
||||||
|
|
||||||
#class one2many_mod_asset(fields.one2many):
|
#class one2many_mod_asset(fields.one2many):
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||||
<separator string="Accounting information" colspan="4" />
|
<separator string="Accounting information" colspan="4" />
|
||||||
<field name="journal_id"/>
|
<field name="journal_id"/>
|
||||||
<field name="account_asset_id"/>
|
<field name="account_asset_id" on_change="onchange_account_depreciation_id(account_asset_id)"/>
|
||||||
<field name="account_depreciation_id"/>
|
<field name="account_depreciation_id"/>
|
||||||
<field name="account_expense_depreciation_id"/>
|
<field name="account_expense_depreciation_id"/>
|
||||||
<group col="4" colspan="4" groups="analytic.group_analytic_accounting">
|
<group col="4" colspan="4" groups="analytic.group_analytic_accounting">
|
||||||
|
|
Loading…
Reference in New Issue