Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
41888 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

 thanks for the answer

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mag 25
982
2
nov 24
2188
4
feb 24
12336
1
gen 24
1675
0
mag 23
1898