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

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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Auteur Beste antwoord

 thanks for the answer

Avatar
Annuleer
Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 25
909
2
nov. 24
2142
4
feb. 24
12272
1
jan. 24
1647
0
mei 23
1869