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

add menuitem for fleet module

By
oumaima
on 5/12/13, 12:18 PM 831 views

Hi everyone, I try to add a new menuitem in the fleet module 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]

fleet.py

enter code here

class fleet_vehicle_type(osv.osv): _name = 'fleet.vehicle.type' _inherit='fleet.vehicle' _order = 'sequence asc' _description = 'Type de vehicule' _columns = { 'name': fields.char('Type', size=64), 'sequence': fields.integer('Sequence', help="Used to order the note stages") } _sql_constraints = [('fleet_type_name_unique','unique(name)', 'Type name already exists')] fleet_vehicle_type()

fleet.xml

enter code here<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="sequence" widget="handler" invisible="1"/>
                <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"/>

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/12/13, 12:18 PM
Seen: 831 times
Last updated: 3/16/15, 8:10 AM