Odoo Help


Custom modules output is not showing value, but it showing the id. How can i solve this?

on 8/30/13, 7:24 AM 1,064 views


import freight


{ 'name': 'Freight Information',

'category': 'General',

'version': '1.1',

'depends': ['base','web'],

'data': ['freight_view.xml'],    

'auto_install': False,



from openerp.osv import fields, osv

class freight_freight(osv.osv):

_name = "freight.freight"    
_columns = {
    'source' : fields.many2one('source.source','Source',required=True), 
            'destination': fields.many2one('destination.destination','Destination',required=True),
    'cost' : fields.char('Charge', size=6, required=True),




    <record model = "ir.ui.view" id = "freight_search">
        <field name = "name"> freight.search </field>
        <field name = "model">freight.freight</field>           
        <field name = "arch" type = "xml"> 
        <search string = "Freight Search" version="7.0">                
            <field name = "source"/>
            <field name = "destination"/>   
            <field name = "cost"/>                  

    <record model = "ir.ui.view" id = "freight_tree">
        <field name = "name">freight.tree</field>
        <field name = "model">freight.freight</field>           
        <field name = "arch" type = "xml">
        <tree string = "Freight" version="7.0">                     
            <field name = "source"/>    
            <field name = "destination"/>   
            <field name = "cost"/>              

    <record model = "ir.ui.view" id = "freight_form">
        <field name = "name">freight.search.form</field>
        <field name = "model">freight.freight</field>           
        <field name = "arch" type = "xml">
        <form string = "Freight" version="7.0">             
            <field name = "source"/>
            <field name = "destination"/>
            <field name = "cost"/>

    <record model = "ir.actions.act_window" id = "action_freight">
        <field name = "name">Freight Information</field>
        <field name = "res_model">freight.freight</field>
        <field name = "view_type">form</field>
        <field name = "view_mode">tree,form</field>


Is there any error in my code?

In the source & destination many2one field, it shows like source.source,1... & destionation.destionation,1...

How can i solve this?

Grover Menacho
On 8/30/13, 11:03 AM

It's because system couldn't find a name into that models. Add this to your classes 'source.source' and 'destination.destination':

class destination_destination(osv.osv):

When you are not adding a 'name' field to the model you have to add the above line because the system is going to look for name or _rec_name, if it finds the rec_name then it's going to display that value.

But is doesnt work. Still showing, destination.destination,1 etc

on 9/2/13, 3:24 AM

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: 8/30/13, 7:24 AM
Seen: 1064 times
Last updated: 3/16/15, 8:10 AM