跳至内容
菜单
此问题已终结
1 回复
7161 查看
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



形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
0
8月 25
805
0
11月 23
2350
2
4月 25
9097
6
9月 21
24387
4
4月 19
5584