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

warning -- Object Error Object 'table' doesn't exist

By
Zouhair
on 8/4/14, 3:06 AM 2,238 views

hi every one,

I have created  a table product_aaaaa_bbbb on openerp database, but i can't request data from the same table, i give an error like this:

warning -- Object Error Object product.aaaaa.bbbb doesn't exist

how i can insert/select data to/from my new table?

thx in advance.

please add your code here then wl chk.......

Odoo
on 8/4/14, 3:11 AM

just i have create table within Postgres

Zouhair
on 8/4/14, 3:24 AM
0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 8/4/14, 3:20 AM

Did you use the regular class to add a table? If not, then do so. It is no use to just create tables within Postgres assuming Odoo can reach them :) .

[EDIT]

class product_aaa_bbb(model.Models)

    _name = 'product.aaa.bbb'

<< ALL of your stuff here>>

 

This should create a table for product_aaa_bbb in your postgres database, which you can reach by using self.pool.get('product.aaa.bbb') from Odoo.

just i have create table within Postgres, any guide to how create it?

Zouhair
on 8/4/14, 3:23 AM

I edited my answer.

Ludo - Neobis
on 8/4/14, 3:33 AM
1

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 8/4/14, 3:35 AM

Hi,

Here I explain how to create a basic module in openerp .please follow the folder structure of modules ,this way you can create table and add datas inside the table.(model=postgres db,view-xml,python=controller....,This is the basic method )

 

init.py----------------------

import barcode_info

 

opeenrp.py----------------------

 

{
'name':'Barcode Generator',
'version':'0.0',
'author':'Libu',
'depends':['base'],
'update_xml' : ['barcode_view.xml'
                                ],
'installable':True,
'category':'General',
'description':'Barcode Geneartor Module',
'website':'',
'demo':[]
}

 

barcode_info.py-----------------

from osv import osv,fields


class barcode_info(osv.osv):
   
    _name='barcode.info'
    
    _columns={
            
             'barcode_id':fields.integer('Product code'),
             'barcode_ref':fields.integer('Reference #'),
             'barcode_price':fields.integer('weight/price'),
             'barcode_name':fields.integer('Barcode'),
             }
       
    def button_generate(self,cr,uid,ids,context=None):
        print " put your code here "
        return True
    
barcode_info()

 

barcode_view.xml----------------------

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        
        <record id="barcode_info_tree" model="ir.ui.view">
                <field name="name">barcode.information</field>
                <field name="model">barcode.info</field>
                <field name="arch" type="xml">
                    <tree string="Barcode">                                    
                        <field name="barcode_id"/>                
                        <field name="barcode_ref"/>
                        <field name="barcode_price"/>
                        <field name="barcode_name"/>
                        
                    </tree>
                </field>                
        </record>
    
        
                <record id="barcode_info_form" model="ir.ui.view">
                <field name="name">barcode.information</field>
                <field name="model">barcode.info</field>
                <field name="arch" type="xml">
                    <form string="Barcode Information">                                    
                        <field name="barcode_id"/>                
                        <field name="barcode_ref"/>
                        <field name="barcode_price"/>
                        <field name="barcode_name"/>
                        

                            <button name="button_generate" string="Generate"
                         class="oe_highlight" type="object"/>    
                             
                             </form>
                         
                     
                </field>                
        </record>
        
        
        <record id="barcode_id_action" model="ir.actions.act_window">
        <field name="name">Barcode Geneartor</field>
        <field name="res_model">barcode.info</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>
        
        
        
        <menuitem id="menu_barcode_main" name="Barcode" />
        <menuitem id="menu_barcode_sub" name="Barcode Generation" parent="menu_barcode_main"/>
        <menuitem id="menu_barcode_sub1" name="Generate" parent="menu_barcode_sub" action="barcode_id_action"/>
        

                                </data>
        
            </openerp>

thank you Libu Koshy

Zouhair
on 8/4/14, 3:53 AM
0
Zouhair
On 8/4/14, 5:04 AM

i have a new module with name product_aaaa_bbbb

__init__.py

import product_aaaa_bbbb

__openerp__.py

{
    'name': 'product aaaa bbbb',
    'version': '0.1',
    'category': 'stock',
    'description': """This module is for .....""",
    'author': 'author',
    'website': 'http://www.site.com/',
    'depends': ['stock','product'],
    'init_xml': [],
    'update_xml': [],
    'demo_xml': [],
    'installable': True,
    'active': True,
}

product_aaaa_bbbb.py

from openerp.osv import osv, fields

class product_aaaa_bbbb(osv.osv):
    _name = "product.aaaa.bbbb"
    _description = "This table is for ......"
    _columns = {
        'location_id': fields.many2one('stock.location','Location',ondelete='no action',required=True,readonly=False),
        'product_id': fields.many2one('product.product','Product',ondelete='no action',required=True,readonly=False),
        'product_qty': fields.integer('Product Quantity',required=True,readonly=False)
    }
product_aaaa_bbbb()

but when request data from new table i get the same error:

warning -- Object Error Object product.aaaa.bbbb doesn't exist

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

2 follower(s)

Stats

Asked: 8/4/14, 3:06 AM
Seen: 2238 times
Last updated: 3/16/15, 8:10 AM