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

aading a new menuitem in fleet module

By
oumaima
on 5/27/13, 11:34 AM 1,603 views

Hi everyone,i'm working with Openerp 7 and i wanna add a new menuitem in the inherit module fleet management and i have this error in the class transport_point _inherit='fleet.vehicle' ^ IndentationError: unexpected indent

myfile.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,
         }

add transport_point() at the end of class transport_point.

Borni DHIFI
on 5/27/13, 11:56 AM

HI I add transport_point() at the end of class transport_point and i still have the same error;any other idea please?

oumaima
on 5/27/13, 12:42 PM
2

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/27/13, 12:57 PM

Hi,

IndentationError: unexpected indent

it is error in syntaxe :we must respect the syntax of python

image description

use 4 space for each block :

image description

Thanks.

0
oumaima
On 5/27/13, 1:01 PM

hi it work's now,it did not work before because i copy and paste from another code...but now i have an error from an xml folder.I have this error:

ValueError: No such external ID currently defined in the system: testflt.menu_root

myfolder.xml

<menuitem name="Parametrage" id="param" parent="menu_root" />

<record model="ir.ui.view" id="view_transport_point_tree_1"> <field name="name">transport.point.tree</field> <field name="model">transport.point</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="Transport Point Information"> <field name="name"/> <field name="amount"/> </tree> </field> </record>

   <!-- Transport Point Form View -->
   <record model="ir.ui.view" id="transport_point_form1">
        <field name="name">transport.point.form</field>
        <field name="model">transport.point</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Transport Point">
                <field name="name" />
                <field name="amount" />
            </form>
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_transport_point">
        <field name="name">Point Information</field>
        <field name="res_model">transport.point</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form,search</field>
    </record>

     <menuitem action="action_transport_point" id="menu_param_parent" parent="param" />

parent="fleet.menu_root"

Borni DHIFI
on 5/27/13, 1:06 PM

thank you it work's

oumaima
on 5/27/13, 1:15 PM

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

1 follower(s)

Stats

Asked: 5/27/13, 11:34 AM
Seen: 1603 times
Last updated: 3/16/15, 8:10 AM