[IMP] account_asset: usability changes for asset history

bzr revid: qdp-launchpad@openerp.com-20110701084233-rcmwin10fh5oq72g
This commit is contained in:
Quentin (OpenERP) 2011-07-01 10:42:33 +02:00
parent 23b8d1aee1
commit 3864c9acf4
4 changed files with 17 additions and 9 deletions

View File

@ -40,7 +40,7 @@ class account_asset_category(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'method': fields.selection([('linear','Linear'),('progressif','Progressive')], 'Computation method', required=True),
'method_delay': fields.integer('Number of Depreciation'),
'method_delay': fields.integer('Number of Depreciations'),
'method_period': fields.integer('Period Length', help="State here the time between 2 depreciations, in months"),
'method_progress_factor': fields.float('Progressif Factor'),
'method_time': fields.selection([('delay','Delay'),('end','Ending Period')], 'Time Method', required=True),
@ -203,7 +203,7 @@ class account_asset_asset(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'method': fields.selection([('linear','Linear'),('progressif','Progressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Linear: Calculated on basis of Gross Value/During (interval) \
\nProgressive: Calculated on basis of Gross Value * Progressif Factor"),
'method_delay': fields.integer('Number of Depreciation', readonly=True, states={'draft':[('readonly',False)]}, help="Calculates Depreciation within specified interval"),
'method_delay': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="Calculates Depreciation within specified interval"),
'method_period': fields.integer('Period Length', readonly=True, states={'draft':[('readonly',False)]}, help="State here the time during 2 depreciations, in months"),
'method_end': fields.date('Ending date', readonly=True, states={'draft':[('readonly',False)]}),
'method_progress_factor': fields.float('Progressif Factor', readonly=True, states={'draft':[('readonly',False)]}),
@ -519,8 +519,9 @@ class account_asset_history(osv.osv):
'user_id': fields.many2one('res.users', 'User', required=True),
'date': fields.date('Date', required=True),
'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
'method_delay': fields.integer('Number of interval'),
'method_period': fields.integer('Period per interval'),
'method_time': fields.selection([('delay','Delay'),('end','Ending Period')], 'Time Method', required=True, help="Delay: Allow users to enter number of periods to generate depreciation lines \n Ending Period: Calculates depreciation lines on the basis of Ending Period Date and Number of Depreciations"),
'method_delay': fields.integer('Number of Depreciations'),
'method_period': fields.integer('Period Length', help="Time in month between two depreciations"),
'method_end': fields.date('Ending date'),
'note': fields.text('Note'),
}

View File

@ -140,14 +140,20 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Asset history">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="date" select="1"/>
<field name="user_id" select="1"/>
<field name="method_delay" select="2"/>
</group>
<group col="2" colspan="2">
<separator string="Depreciation Dates" colspan="2" />
<field name="method_time"/>
<field name="method_delay" attrs="{'invisible':[('method_time','=','end')]}"/>
<field name="method_period"/>
<field name="method_end"/>
<separator string="Notes" colspan="4"/>
<field name="note" colspan="4" nolabel="1"/>
<field name="method_end" attrs="{'invisible':[('method_time','=','delay')]}"/>
</group>
<separator string="Notes" colspan="4"/>
<field name="note" colspan="4" nolabel="1"/>
</form>
</field>
</record>

View File

@ -109,6 +109,7 @@ class asset_modify(osv.osv_memory):
history_vals = {
'asset_id': asset_id,
'name': data.name,
'method_time': asset.method_time,
'method_delay': asset.method_delay,
'method_period': asset.method_period,
'method_end': asset.method_end,

View File

@ -11,11 +11,11 @@
<group colspan="4" col="4">
<separator string="Asset durations to modify" colspan="4"/>
<field name="name" colspan="4"/>
<field name="method_period"/>
<group colspan="2" col="2">
<field name="method_delay"/>
<field name="method_end"/>
</group>
<field name="method_period"/>
<separator string="Notes" colspan="4"/>
<field name="note" nolabel="1" colspan="4"/>
</group>