Odoo Help


how to add a new menuitem in an inherit module

on 5/14/13, 7:55 AM 3,690 views

Hi everyone,i want to modify the fleet module and add a new menuitem but i have this error when i want to add a new field: 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]


class fleet_vehicle_type(osv.osv):
_name = 'fleet.vehicle.type'
_inherit='  fleet.vehicle.model.brand'
_order = 'sequence asc'
_description = 'Type de vehicule'
_columns = {
  'name': fields.char('Type', size=64),

my file.xml

  <?xml version="1.0" encoding="utf-8"?>
    <record model='ir.ui.view' id='fleet_vehicle_type_tree'>
        <field name="name">fleet.vehicle.type.tree</field>
        <field name="model">fleet.vehicle.type</field>
        <field name="arch" type="xml">
            <tree string="Types" version="7.0" editable="bottom">
                <field name="name" />

    <record model='ir.actions.act_window' id='fleet_vehicle_type_act'>
        <field name="name">Type de vehicule</field>
        <field name="res_model">fleet.vehicle.type</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
          <p class="oe_view_nocontent_create">
            Click to create a new type.

    <menuitem action="fleet_vehicle_type_act" parent="fleet.fleet_configuration" id="fleet_vehicle_type_menu" groups="base.group_no_one"/>


the error is not caused by adding menu. It seems that a mandatory field is not correctly set

on 5/14/13, 8:39 AM

what should i do please?

on 5/14/13, 9:35 AM

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
AJ Schrafel Paper Corp
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 5/14/13, 12:30 PM

The field license_plate in model license.plate was removed improperly.

If you added in a custom module, you will have to put back the original python file that references that field, stop/start your sever, update the module, then uninstall the module completely before you can use the new code.

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/14/13, 7:55 AM
Seen: 3690 times
Last updated: 3/16/15, 8:10 AM