diff options
| author | Christophe Simonis <chs@openerp.com> | 2013-11-21 13:06:37 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2013-11-21 13:06:37 +0100 |
| commit | fc9c571bcd4dedef872909cb04939d063941df97 (patch) | |
| tree | c9d09dfe4590bd3f85a13014522da931760da4d4 /addons/fleet | |
| parent | 6f6714390855fd47ad010206ec60b7e7c885461f (diff) | |
[FIX] fleet: inherits reference fields must be required.
Note: there is no db schema change as orm was forcing these values.
bzr revid: chs@openerp.com-20131121120637-c5ufw20ck30hefr5
Diffstat (limited to 'addons/fleet')
| -rw-r--r-- | addons/fleet/fleet.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 483f989fcde..4f14814b356 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -559,7 +559,7 @@ class fleet_vehicle_log_fuel(osv.Model): 'inv_ref': fields.char('Invoice Reference', size=64), 'vendor_id': fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'notes': fields.text('Notes'), - 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost'), + 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost', required=True, ondelete='cascade'), 'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database } _defaults = { @@ -600,7 +600,7 @@ class fleet_vehicle_log_services(osv.Model): 'vendor_id': fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"), 'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database 'notes': fields.text('Notes'), - 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost'), + 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost', required=True, ondelete='cascade'), } _defaults = { 'date': fields.date.context_today, @@ -799,7 +799,7 @@ class fleet_vehicle_log_contract(osv.Model): 'cost_frequency': fields.selection([('no','No'), ('daily', 'Daily'), ('weekly','Weekly'), ('monthly','Monthly'), ('yearly','Yearly')], 'Recurring Cost Frequency', help='Frequency of the recuring cost', required=True), 'generated_cost_ids': fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs', ondelete='cascade'), 'sum_cost': fields.function(_get_sum_cost, type='float', string='Indicative Costs Total'), - 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost'), + 'cost_id': fields.many2one('fleet.vehicle.cost', 'Cost', required=True, ondelete='cascade'), 'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database } _defaults = { |
