[FIX]Resolve conflict in demo

bzr revid: dle@openerp.com-20121018152310-hjd8mqyl38ulp12b
This commit is contained in:
Denis Ledoux dle@openerp.com 2012-10-18 17:23:10 +02:00
commit ed3bd219a3
2 changed files with 11 additions and 10 deletions

View File

@ -5,18 +5,12 @@
'author' : 'OpenERP S.A.',
'category': 'Vehicle, leasing, insurances, costs',
'website' : 'http://www.openerp.com',
'summary' : 'Manage your fleet of vehicle',
'summary' : 'Manage all your vehicles and contracts',
'description' : """
Vehicle, leasing, insurances, cost
==================================
With this easy to use module, you can in a few clicks manage your entire vehicle fleet.
Managing a single vehicle or thousands of them has never been easier.
Encode your vehicle, group them with tags, view the ones that interest you with the search function.
Add insurance and services reminder that will help you by sending you a mail when you need to renew the insurance of a vehicle or do the next maintenance.
""",
'depends' : [
'base',

View File

@ -88,6 +88,8 @@ class fleet_vehicle_state(osv.Model):
'sequence': fields.integer('Order',help="Used to order the note stages")
}
_order = 'sequence asc'
_sql_constraints = [('fleet_state_name_unique','unique(name)','State name already exists')]
############################
############################
@ -365,20 +367,20 @@ class fleet_vehicle(osv.Model):
'company_id': fields.many2one('res.company', 'Company'),
'license_plate' : fields.char('License Plate', size=32, required=True, help='License plate number of the vehicle (ie: plate number for a car)'),
'vin_sn' : fields.char('Chassis Number', size=32, required=False, help='Unique number written on the vehicle motor (VIN/SN number)'),
'driver' : fields.many2one('res.partner', 'Driver',required=False, help='Driver of the vehicle', domain="['|',('customer','=',True),('employee','=',True)]"),
'driver' : fields.many2one('res.partner', 'Driver',required=False, help='Driver of the vehicle', domain="[('employee','=',True)]"),
'model_id' : fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'),
'log_fuel' : fields.one2many('fleet.vehicle.log.fuel','vehicle_id', 'Fuel Logs'),
'log_services' : fields.one2many('fleet.vehicle.log.services','vehicle_id', 'Services Logs'),
'log_contracts' : fields.one2many('fleet.vehicle.log.contract','vehicle_id', 'Contracts'),
'acquisition_date' : fields.date('Acquisition Date', required=False, help='Date when the vehicle has been bought'),
'color' : fields.char('Color',size=32, help='Color of the vehicle'),
'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ),
'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle'),
'location' : fields.char('Location',size=32, help='Location of the vehicle (garage, ...)'),
'doors' : fields.integer('Doors Number', help='Number of doors of the vehicle'),
'tag_ids' :fields.many2many('fleet.vehicle.tag','fleet_vehicle_vehicle_tag_rel','vehicle_tag_id','tag_id','Tags'),
'odometer' : fields.function(_get_odometer,fnct_inv=_set_odometer,type='char',string='Odometer Value',store=False,help='Odometer measure of the vehicle at the moment of this log'),
'odometer_unit': fields.selection([('kilometers', 'Kilometers'),('miles','Miles')], 'Odometer Unit', help='Unit of the odometer ',required=False),
'odometer_unit': fields.selection([('kilometers', 'Kilometers'),('miles','Miles')], 'Odometer Unit', help='Unit of the odometer ',required=True),
'transmission' : fields.selection([('manual', 'Manual'),('automatic','Automatic')], 'Transmission', help='Transmission Used by the vehicle',required=False),
'fuel_type' : fields.selection([('gasoline', 'Gasoline'),('diesel','Diesel'),('electric','Electric'),('hybrid','Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle',required=False),
@ -401,8 +403,13 @@ class fleet_vehicle(osv.Model):
_defaults = {
'doors' : 5,
'odometer_unit' : 'kilometers',
'state' : lambda s,cr,uid,c:s.get_state(cr,uid,'Active',context=c),
}
def get_state(self,cr,uid,state_name,context=None):
states=self.pool.get('fleet.vehicle.state').search(cr,uid,[('name','=',state_name)],context=context,limit=1)
return states
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}