Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7122 Lượt xem
0

I added field

class account_invoice_line(osv.osv):
    _inherit = 'account.invoice.line'

_columns = {
        'rel_stock_move_ids': fields.one2many('stock.move', 'invoice_line_id', string='Moves')
    }

but getting error

invf = comodel._fields[self.inverse_name]
KeyError: 'invoice_line_id'

and in stock.move i have


class stock_move(osv.osv):
    _inherit = "stock.move"

    _columns = {
        'invoice_line_id': fields.many2one(
            'account.invoice.line', 'Invoice Line', readonly=True
        ),
    }

why my inverse_name is not working? as there is field invoice_line_id in stock.move



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello @Grf


Have you imported account invoice line class first ? If yes then you should first load stock move class (or file if you created different file). 

Here It seems "invoice_line_id" is not created proparly.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 25
796
0
thg 11 23
2340
KeyError: 'socket' Đã xử lý
2
thg 4 25
9085
6
thg 9 21
24383
4
thg 4 19
5579