콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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

작성자

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

Hello you have found any solution related to this error ?

베스트 답변

I have the same problem: https://www.odoo.com/forum/help-1/question/compute-many2one-from-custom-model-s-178461


아바타
취소
베스트 답변

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

작성자

i have also created new db

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?

작성자

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

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

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

관련 게시물 답글 화면 활동
1
3월 23
2273
0
12월 22
2911
0
6월 21
2882
0
6월 20
5389
1
11월 19
2711