[ADD]working buttons and removed log tab from vehicle view
bzr revid: csn@openerp.com-20120927075726-kdimd6ru0g1fysph
This commit is contained in:
+16
-16
@@ -75,29 +75,29 @@ class fleet_vehicle(osv.Model):
|
||||
return dict(res)
|
||||
|
||||
|
||||
def act_show_log(self, cr, uid, ids, context=None):
|
||||
def act_show_log_services(self, cr, uid, ids, context=None):
|
||||
""" This opens log view to view and add new log for this vehicle
|
||||
@return:
|
||||
@return: the service log view
|
||||
"""
|
||||
#print 'HELLO YOU--------------------------------------------'
|
||||
#print ids[0]
|
||||
|
||||
#vehicle = self.browse(cr, uid, ids[0], context)
|
||||
#logids = self.browse(cr,uid,log_ids,context)
|
||||
#print vehicle
|
||||
#print vehicle.name
|
||||
#print vehicle.registration
|
||||
#print logids
|
||||
#print logids.type
|
||||
category = self.pool.get('ir.model.data').get_object(cr, uid, 'fleet', 'fleet_vehicle_form', context)
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log', context)
|
||||
#return res
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_services', context)
|
||||
res['context'] = {
|
||||
'default_vehicle_id': ids[0]#'Corsa',#category and category.id or False,
|
||||
'default_vehicle_id': ids[0]
|
||||
}
|
||||
res['domain']=[('vehicle_id','=', ids[0])]
|
||||
return res
|
||||
|
||||
def act_show_log_fuel(self, cr, uid, ids, context=None):
|
||||
""" This opens log view to view and add new log for this vehicle
|
||||
@return: the service log view
|
||||
"""
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','act_show_log_fuel', context)
|
||||
res['context'] = {
|
||||
'default_vehicle_id': ids[0]
|
||||
}
|
||||
res['domain']=[('vehicle_id','=', ids[0])]
|
||||
return res
|
||||
|
||||
|
||||
_name = 'fleet.vehicle'
|
||||
_description = 'Fleet Vehicle'
|
||||
|
||||
|
||||
@@ -76,7 +76,8 @@
|
||||
<sheet>
|
||||
|
||||
<div class="oe_right oe_button_box">
|
||||
<button name="act_show_log" type="object" string="show logs" help="show different logs for this vehicle" />
|
||||
<button name="act_show_log_services" type="object" string="show services logs" help="show the services logs for this vehicle" />
|
||||
<button name="act_show_log_fuel" type="object" string="show fuel logs" help="show the fuel logs for this vehicle" />
|
||||
</div>
|
||||
|
||||
<field name="image" widget='image'/>
|
||||
@@ -137,7 +138,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Logs">
|
||||
<!-- <page string="Logs">
|
||||
<group>
|
||||
<field name="log_services">
|
||||
<tree string="Completed services">
|
||||
@@ -201,7 +202,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</page> -->
|
||||
<page string="Engine">
|
||||
<group col="2">
|
||||
<group>
|
||||
@@ -242,12 +243,21 @@
|
||||
|
||||
<act_window
|
||||
context="{'default_vehicle_id': active_id}"
|
||||
id="act_show_log"
|
||||
name="Logs"
|
||||
id="act_show_log_services"
|
||||
name="Services Logs"
|
||||
res_model="fleet.vehicle.log.services"
|
||||
src_model="fleet.vehicle"
|
||||
view_mode="tree,form"
|
||||
view_type="form"/>
|
||||
|
||||
<act_window
|
||||
context="{'default_vehicle_id': active_id}"
|
||||
id="act_show_log_fuel"
|
||||
name="Fuel Logs"
|
||||
res_model="fleet.vehicle.log.fuel"
|
||||
src_model="fleet.vehicle"
|
||||
view_mode="tree,form"
|
||||
view_type="form"/>
|
||||
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_act'>
|
||||
|
||||
Reference in New Issue
Block a user