İçereği Atla
Menü
Bu soru işaretlendi
4 Cevaplar
41736 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici En İyi Yanıt

 thanks for the answer

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
May 25
895
2
Kas 24
2113
4
Şub 24
12252
sale / delivery Çözüldü
1
Oca 24
1621
0
May 23
1848