Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
41676 Widoki

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)

Awatar
Odrzuć
Najlepsza odpowiedź

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",
    ],
Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

 thanks for the answer

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 25
878
2
lis 24
2082
4
lut 24
12226
sale / delivery Rozwiązane
1
sty 24
1588
0
maj 23
1832