Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
6826 Weergaven

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

Avatar
Annuleer
Beste antwoord

Hello Jonathankabre,

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

Avatar
Annuleer
Beste antwoord

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



Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
nov. 19
10658
1
mei 24
4177
3
dec. 22
4697
3
aug. 22
13977
1
dec. 19
8264