Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Integrity Error fleet module

By
oumaima
on 5/30/13, 6:45 AM 1,323 views

Hi,i'm trying to modify the fleet module of openerp 7 I added a new class: transport.point but i have this error : Integrity Error

The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set

[object with reference: license_plate - license.plate]

even if i didn't linked this class with the fleet.vehicle

file.py

class fleet_vehicle(osv.osv):

_name = 'fleet.vehicle'
_inherit='fleet.vehicle'
_columns = {
  'type':fields.selection([('ci','C.I'), ('fourgon','Fourgon'),('fourgonnette','Fourgonnette'),('minibus','Mini-bus'),('pickup','Pick-up'),('poidslourds','Poids Lourds'),('vfonction','V.fonction')],'Type'),
  'chauffeur': fields.many2one('hr.employee', 'Chauffeur',required=True),
  'name': fields.char('Nom du point', size=50, required=True),
  'amount': fields.float('Montant'),
}

fleet_vehicle()

class transport_point(osv.osv):
_name = 'transport.point'
     _inherit="fleet.vehicle"
_columns = {
    'name': fields.char('Nom du point', size=50, required=True),
    'amount': fields.float('Montant'),
}
_defaults={
    'amount': 0,
}

transport_point()

0

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 5/30/13, 7:13 AM

Hi,

you have installed a base with demo data and you deleted a mandatory data.This error has no relation in your new class transport.point. To solve the problem :

1°-upgrade module fleet : settings>>Installed Modules>>Fleet Management>>upgrade

or

2°-create a new database.

Hi,I tried both options and i still have the same error;any other idea?

oumaima
on 5/30/13, 7:39 AM

try to use a new database . should it work.

Borni DHIFI
on 5/30/13, 7:45 AM

i create a new database and i still have this error...

oumaima
on 5/30/13, 7:46 AM

So you changed the original code a module fleet, use the original code of module fleet and should it work.

Borni DHIFI
on 5/30/13, 7:50 AM

yes i updated the module fleet.vehicle but i didn't erase the field license_plate and i just added 2 fields in the module fleet.vehicle

oumaima
on 5/30/13, 8:03 AM

it work's now;i erased the _inherit="fleet.vehicle" from the trannsport.point module

oumaima
on 5/30/13, 9:42 AM

but in the code transport_point does not exist _inherit="fleet.vehicle"

Borni DHIFI
on 5/30/13, 9:59 AM

I update the question;thank's

oumaima
on 5/30/13, 11:08 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/30/13, 6:45 AM
Seen: 1323 times
Last updated: 3/16/15, 8:10 AM