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

[Odoo 8] ProgrammingError: column "id" does not exist

By
Tazan
on 7/3/15, 5:41 AM 1,264 views

I have a model

class fbv_use_carrier(models.TransientModel):

pickings = fields.Many2many('stock.picking', 'fbv_use_carrier_line', 'fbv_id', 'picking_id', 'Picking List') 
 class fbv_use_carrier_line(models.TransientModel):
_name=
'fbv.use.carrier.line'


picking_id = fields.Many2one('stock.picking', string='List Piking')
fbv_id = fields.Many2one('fbv.use.carrier', string='FBV Use Carrier ID'

But i have error!

 ProgrammingError: column "id" does not exist
LINE 1: SELECT id FROM fbv_use_carrier_line WHERE COALESCE(write_dat...

Hoping for some feedback!

Thanks

Did you defined name for your class ? like _name = 'fbv.use.carrier'

Emipro Technologies Pvt. Ltd.
on 7/3/15, 5:58 AM
1

Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
http://www.odoo.com
5975
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 7/3/15, 7:32 AM

Hello,

Your problem is "very very" simple,

Solution : 

Just modify the name of table in M2M field definition. Like as below, ( I have marked as bold + italic + underline )

pickings = fields.Many2many('stock.picking', 'fbv_use_carrier_line', 'fbv_id', 'picking_id', 'Picking List')

Reason of Error :

When you define many2many field, 2nd argument creates the table. Now you have given the same name of the table which you have used while defining following class, ( I have marked bold + italic + underline )

class fbv_use_carrier_line(models.TransientModel):
_name='fbv.use.carrier.line'
picking_id = fields.Many2one('stock.picking', string='List Piking')
fbv_id = fields.Many2one('fbv.use.carrier', string='FBV Use Carrier ID'

By adding same name of new M2M table, system overrides new table definition and of course "ID" column will be removed. ( FYI : M2M table stores only 2 columns ). That is why when system evaluates following line,

fbv_id = fields.Many2one('fbv.use.carrier', string='FBV Use Carrier ID'

it shows you error. ( ProgrammingError: column "id" does not exist )

Hope this answer will lead to exact solution of your problem !

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/3/15, 6:28 AM

Tazan,

You probably have misunderstood the concept of Many2Many. Its used when you are linking an existing records of another model.

What I read from your code is, you are trying to establish the one2many relation to lines, but you miss it. One2many is used to link multiple lines on dynamism.

If you have written the one2many field, the reference field should be named as fbv_id which is defined as Many2one in carrier lines.

carrier_line_ids = fields.One2many('fbv.use.carrier.line','flv_id', 'Lines').

Hope this helps.

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: 7/3/15, 5:41 AM
Seen: 1264 times
Last updated: 7/3/15, 7:37 AM