跳至內容
選單
此問題已被標幟
2 回覆
6849 瀏覽次數

hi

someone can help me about houw to resolve

: TypeError: Model 'account.invoice' does not exist in registry. - - -

this appens when i add this class to my module:

[code]

class AccountInvoice(models.Model):
    _name = "account.invoice"
    _description = "Partner"
    _inherit = 'account.invoice'

    reference_fact_frnss = fields.Char(string='Ref. facture fournisseur')

[/code]

thanks

i use odoo v12 community

頭像
捨棄
最佳答案

Hello Jonathankabre,

Make sure you have added 'account' module in depends.

頭像
捨棄
最佳答案

Hi, 

    While inheriting the default class in your custom module, you should not use _name , use _inherit instead.

Since you have already used it in your code , remove _name = "account.invoice" and try again.

And make sure that in your manifest file in custom module you have added the account module in depends.

Please check the documentation here for inheriting, https://www.odoo.com/documentation/12.0/howtos/backend.html#inheritance

Hope it helps,

Thanks



頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
11月 19
10680
1
5月 24
4179
3
12月 22
4703
3
8月 22
13987
1
12月 19
8267