Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
4 Besvarelser
41953 Visninger

i can inherit res.partner model but i cant inherit sale.order model

i try to inherit sale.order model but it say TypeError: Model 'sale.order' does not exist in registry when i try to inherit sale.order

can someone help me?

from odoo import models, fields, api

class Partner(models.Model):

    _inherit = 'sale.order'

        instructor = fields.Boolean(string="Instruktur")

    session_ids = fields.Many2many('training.sesi', string="Menghadiri Sesi", readonly=True)

Avatar
Kassér
Bedste svar

Hi,

make sure you added the module 'sale' to the dependencies of your new module. Look at the manifest file of your module. There should be at least:

    "depends": [
        "sale",
    ],
Avatar
Kassér
Bedste svar

FYI -it can alsao happen when there is a depends redunancy where two modules refer to each other in the manifest's depends. Only one must make reference to the other not both.

Avatar
Kassér
Forfatter Bedste svar

 thanks for the answer

Avatar
Kassér
Bedste svar

It's dependency issue, added sale dependency on your custom module

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
maj 25
1019
2
nov. 24
2213
4
feb. 24
12382
1
jan. 24
1690
0
maj 23
1914