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

how to add a new menuitem in an inherit module

By
oumaima
on 5/14/13, 7:55 AM 3,529 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]

myfile.py

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),
}
fleet_vehicle_type()

my file.xml

  <?xml version="1.0" encoding="utf-8"?>
  <openerp>
    <data>
    <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" />
            </tree>
        </field>
    </record>

    <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.
          </p>
        </field>
    </record>

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

    </data>
  </openerp>

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

saad
on 5/14/13, 8:39 AM

what should i do please?

oumaima
on 5/14/13, 9:35 AM
0

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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