[ADD]cars.xml brand demo values + [FIX]Create cost without parent
bzr revid: dle@openerp.com-20121005095818-9j0hgwcjyukkp45l
This commit is contained in:
parent
615e729e32
commit
c6869b0519
|
@ -27,7 +27,7 @@ Add insurance and services reminder that will help you by sending you a mail whe
|
|||
'data.xml',
|
||||
],
|
||||
'update_xml' : ['security/ir.model.access.csv'],
|
||||
'demo': ['demo.xml'],
|
||||
'demo': ['cars.xml','demo.xml'],
|
||||
'installable' : True,
|
||||
'application' : True,
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -45,12 +45,12 @@ class fleet_vehicle_cost(osv.Model):
|
|||
'cost_type': fields.many2one('fleet.service.type', 'Service type', required=False, help='Service type purchased with this cost'),
|
||||
'amount': fields.float('Total Price'),
|
||||
'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', required=False, help='Parent cost to this current cost'),
|
||||
'cost_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Services covered'),
|
||||
'cost_ids' : fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'),
|
||||
'date' :fields.date('Cost Date',help='Date when the cost has been executed'),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
if 'parent_id' in data:
|
||||
if 'parent_id' in data and data['parent_id']:
|
||||
data['vehicle_id'] = self.browse(cr, uid, data['parent_id'], context=context).vehicle_id.id
|
||||
data['date'] = self.browse(cr, uid, data['parent_id'], context=context).date
|
||||
cost_id = super(fleet_vehicle_cost, self).create(cr, uid, data, context=context)
|
||||
|
|
|
@ -603,8 +603,8 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Total Fuel amount per month">
|
||||
<field name="date" />
|
||||
<field name="vehicle_id" group="True" />
|
||||
<field name="amount" operator="+"/>
|
||||
<field name="vehicle_id" group="True" />
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -802,6 +802,9 @@
|
|||
<field name="parent_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cost_ids"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue