Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6886 มุมมอง

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



อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 19
10701
1
พ.ค. 24
4188
Calling two models in one model แก้ไขแล้ว
3
ธ.ค. 22
4715
3
ส.ค. 22
14013
1
ธ.ค. 19
8287