[ADD]Cost types

bzr revid: dle@openerp.com-20121003085702-0uc4ynbw0hl51sx0
This commit is contained in:
Denis Ledoux dle@openerp.com 2012-10-03 10:57:02 +02:00
parent 8d52f11708
commit befdb18c74
2 changed files with 26 additions and 0 deletions

View File

@ -5,6 +5,15 @@ import tools
import datetime
class fleet_vehicle_cost(osv.Model):
_name = 'fleet.vehicle.cost'
_description = 'Cost of vehicle'
_columns = {
'price': fields.float('Price'),
'type': fields.many2one('fleet.service.type', 'Service type', required=True, help='Service type purchased with this cost'),
'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this cost'),
}
class fleet_vehicle_model_type(osv.Model):
_name = 'fleet.vehicle.type'
_description = 'Type of the vehicle'
@ -564,6 +573,7 @@ class fleet_vehicle_log_contract(osv.Model):
'ins_ref' : fields.char('Contract Reference', size=64),
'state' : fields.many2one('fleet.contract.state', 'Contract Status', help='Choose wheter the contract is still valid or not'),
'notes' : fields.text('Terms and Conditions'),
'costs' : fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs covered'),
}
_defaults = {
'purchaser_id': lambda self, cr, uid, ctx: uid,

View File

@ -365,6 +365,22 @@
<field name="ins_ref" />
</group>
</group>
<group>
<field name="costs" >
<tree string="Costs" version="7.0">
<field name="type" />
<field name="price" />
</tree>
<form string="Costs" version="7.0">
<sheet>
<group>
<field name="type" />
<field name="price" />
</group>
</sheet>
</form>
</field>
</group>
<group col="2">
<group string="Odometer details">
<div>