Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
7124 Ansichten
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



Avatar
Verwerfen
Beste Antwort

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.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Aug. 25
796
0
Nov. 23
2342
2
Apr. 25
9085
6
Sept. 21
24384
4
Apr. 19
5580