Odoo Help


getting list of customer from res.partner on tree view

on 6/6/13, 4:08 AM 3,187 views

I am a new to python and openerp. the following code loads into openerp with no errors; however, I am not seeing any data from res.partner as I am expecting to.

Can anyone see what the problem is in my code?

 class delivery_forcast(osv.osv):

    _name = "delivery.forcast"
    _inherit = "res.partner"
        'delivery_state': fields.selection([
                'Delivery Status', readonly=True, track_visibility='onchange'),
        'est_delivery_date': fields.date('Estimated Delivery Date', readonly=False),
        'container_size': fields.integer('Container Size', help='Container size to be filled in gallons',readonly=False),


<?xml version="1.0" encoding="utf-8"?>
        <record id="view_delivery_forcast_tree" model="ir.ui.view">
            <field name="name">delivery.forcast.tree</field>
            <field name="model">delivery.forcast</field>
            <field name="arch" type="xml">
                <tree string="Partner List">
                    <field name="name"/>
                    <field name="est_delivery_date"/>  
                    <field name="container_size"/>   
                    <field name="delivery_state"/> 

        <record id="show_delivery_forcast_tree" model="ir.actions.act_window">
            <field name="name">Delivery Forcasts</field>
            <field name="res_model">delivery.forcast</field>
            <field name="view_type">tree</field>
            <field name="view_mode">tree</field>
            <field name ="domain">[('customer','=',1)]</field>  

        <menuitem name="Delivery Forcasts" id="menu_delivery_forcasts" action="show_delivery_forcast_tree"/>



When you are inheriting a model and creating another model, the new model will not have the data from inherited model.

Here you have inherited res.partner and created new model delivery.forcast. So data will be stored in new table delivery_forecast.

You have to specify the table name of the inherited model in order to show all the data in _table.

It should be like this:

_name = 'delivery.forcast'
_inherit = 'res.partner'
_table = 'res_partner'

It will show all the data in res_partner.

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: 6/6/13, 4:08 AM
Seen: 3187 times
Last updated: 3/16/15, 8:10 AM