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

openerp coloum relation does n't exist..

By
charlesraj
on 5/23/13, 5:23 AM 2,539 views

hi . i create a model named x_customer it has two field x_custprice and x_custproduct and creating the form view,tree view for this. while entering values to this field an error message is shown like this.

ProgrammingError: column "x_custprice" of relation "x_customer" does not exist LINE 1: insert into "x_customer" (id,"x_custprice","x_custproduct",c...

please help me to find the problem

update ur code here or clear error message show me.

sridhar
on 5/23/13, 6:46 AM

OpenERP Server Error Client Traceback (most recent call last): File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\controllers\main.py", line 1129, in call_kw File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\controllers\main.py", line 1121, in _call_kw File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\session.py", line 43, in proxy File "C:\Program Files\OpenERP 7.0-2013

charlesraj
on 5/23/13, 6:55 AM

Server Traceback (most recent call last): File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server\openerp\addons\web\session.py", line 90, in send File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server.\openerp\netsvc.py", line 293, in dispatch_rpc File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server.\openerp\service\web_services.py", line 626, in dispatch File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server.\openerp\osv\osv.py", line 188, in execute_kw File "C:\Program Files\OpenERP 7.0-20130509-231040\Server\server.\openerp\osv\osv.py"

charlesraj
on 5/23/13, 6:56 AM

ProgrammingError: column "x_custprice" of relation "x_customer" does not exist LINE 1: insert into "x_customer" (id,"x_custprice","x_custproduct",c... ^

charlesraj
on 5/23/13, 6:57 AM

send ur xml file and py file

sridhar
on 5/23/13, 6:59 AM

Tree view. <?xml version="1.0"?> <tree string="Purchase Order" version="7.0">

       <field name="x_custproduct"/>
       <field name="x_custprice"/>
            </tree>
charlesraj
on 5/23/13, 7:11 AM

Form view. <?xml version="1.0"?> <form string="Purchase Order" version="7.0"> <group> <field name="x_custproduct"/> <field name="x_custprice" /> </group> </form>

charlesraj
on 5/23/13, 7:13 AM

i did n't have the py file.

charlesraj
on 5/23/13, 7:13 AM

dont having py means how it will work

sridhar
on 5/23/13, 7:16 AM

i just create a new model, then create 2 fields then add it under to a menu. Edited the corresponding views and add the field names to it ( above mentioned form view and tree view).

charlesraj
on 5/23/13, 7:22 AM

in purchase order which place do u want this fields...

sridhar
on 5/23/13, 7:29 AM

i dont want these in purchase order. I just created it as a new module..

charlesraj
on 5/23/13, 8:35 AM

that means no inheritance correct.

sridhar
on 5/23/13, 8:47 AM

here no relation with inheritance. just created a UI for adding product, price , it will be displayed , product will be listed under the product. But cant able to save. At that time the above mentioned error will be displayed

charlesraj
on 5/23/13, 9:05 AM

i think concept is wrong u didn't inherit means how it will work... u doing a which module, product or purchase...

sridhar
on 5/23/13, 9:17 AM

products..

charlesraj
on 5/23/13, 9:43 AM
1
sridhar
On 5/24/13, 2:30 AM
create the module like this,

    {
        'name': 'Inheritance Error Solving',
        'version': '1.1',
        'category': 'Generic Modules',
        'description': """
        Product master two field adding
           """,
        'author': 'Sridhar',
        'depends': ['base','product'],
        'update_xml': ['product_inheritance_view.xml'],
        'installable': True,
        'active': False,
    } 

save this file __openerp__.py
import time
from datetime import datetime, timedelta
from openerp.osv import fields, osv
from tools.translate import _


class product_inheritance(osv.osv):
    _inherit = 'product.product'
    _columns = {
        'x_custproduct':fields.char('Product',size=8),
        'x_custprice':fields.integer('Price'),

    }

product_inheritance()
save this file as product_inheritace.py

<?xml version="1.0"?>
<openerp>
    <data>
    <record model="ir.ui.view" id="product_order_formss">
        <field name="name">product.product.form</field>
        <field name="model">product.product</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="product.product_normal_form_view"/>
        <field name="arch" type="xml">
            <field name="name" position="after">
                <group>
            <field name="x_custproduct"></field>
            <field name="x_custprice"></field>
            </group>
            </field>
        </field>
    </record>
    </data>
</openerp>
save this file as product_inheritance_view.xml it will work 
finally __init__.py in this py file add the line

import product_inheritance

dont do base file if do base file means it make error so inherit the file and do ur customization.

thanks....

charlesraj
on 5/24/13, 3:02 AM

vote me for my future reference...

sridhar
on 5/24/13, 3:07 AM

sir i need another help.

charlesraj
on 5/24/13, 3:11 AM

do you help me in my new question

charlesraj
on 5/24/13, 3:12 AM

ask me... answer correct means put right mark.

sridhar
on 5/24/13, 3:15 AM

ok. question is posted.

charlesraj
on 5/24/13, 3:17 AM

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/23/13, 5:23 AM
Seen: 2539 times
Last updated: 3/16/15, 8:10 AM