[ADD]cars.xml brand demo values + [FIX]Create cost without parent

bzr revid: dle@openerp.com-20121005095818-9j0hgwcjyukkp45l
This commit is contained in:
Denis Ledoux dle@openerp.com 2012-10-05 11:58:18 +02:00
parent 615e729e32
commit c6869b0519
5 changed files with 13743 additions and 1804 deletions

View File

@ -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,
}

13736
addons/fleet/cars.xml Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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)

View File

@ -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>