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.

1

ProgrammingError: relation "_unknown" does not exist

By
Jignesh Mehta
on 2/8/16, 2:50 AM 636 views

Hello,


I'm working on odoo9. I'm facing one issue in which i have 1 One2many field in the sale order line and for the relation there is 1 Many2one field.


Now in the One2many field class, there is 1 Many2one field to another object.


On the click of button, i write some data in the sale order line's One2many fields and it is written also correctly.


But, now in the Many2one field, display _unknown,id instead of just id.


For more Info:-

class SaleOrderLine(models.Model):

     _inherit = 'sale.order.line'

    lot_line_ids = fields.One2many('lot.line.detail', 'line_id', 'Lot Ids')



class LotLineDetail(models.Model):

    _name = 'lot.line.detail'

    _description = "Lot Line Detail"

    line_id = fields.Many2one('sale.order.line', 'Sale Order Line')

    lot_line_id = fields.Many2one('lot.detail', string='Lot Line Id')

    lot_line_qty = fields.Float('Quantity')


In the lot_line_id, i have facing _unknown error.

Thanks in advance,


Where is defined the model lot.detail?? in another module? if yes then you should put a dependency with that module in your __openerp__.py

Axel Mendoza
on 2/8/16, 4:43 AM

found the error and solve it. Thanks both of you for quick reply

Jignesh Mehta
on 2/8/16, 4:54 AM
0
Gerhard Baumgartner
On 2/8/16, 3:27 AM

Start by checking if all files are included in your __init__.py.

If everything is included try restarting odoo & postgres.

i have restart both odoo and postgres, but the error is still there

Jignesh Mehta
on 2/8/16, 4:01 AM

i have also created new db

Jignesh Mehta
on 2/8/16, 4:02 AM

lot_line_id = fields.Many2one('lot.detail', string='Lot Line Id') You refer to 'lot.detail', does this model exist or should it refer to 'lot.line.detail' like the member name suggests?

Gerhard Baumgartner
on 2/8/16, 4:15 AM

lot.detaill model is already exist and also apply the _rec_name for lot.line.detail

Jignesh Mehta
on 2/8/16, 4:37 AM

Could you post the full error and lot.detail class, please?

Gerhard Baumgartner
on 2/8/16, 4:40 AM

also add in class SaleOrderLine: _name = 'sale.order.line'

Gerhard Baumgartner
on 2/8/16, 4:42 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: 2/8/16, 2:50 AM
Seen: 636 times
Last updated: 2/12/16, 7:24 AM