Skip to Content
Menú
This question has been flagged
4 Respostes
41632 Vistes

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
Descartar
Best Answer

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
Descartar
Best Answer

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
Descartar
Autor Best Answer

 thanks for the answer

Avatar
Descartar
Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de maig 25
850
2
de nov. 24
2045
4
de febr. 24
12166
1
de gen. 24
1559
0
de maig 23
1802