تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
41924 أدوات العرض

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)

الصورة الرمزية
إهمال
أفضل إجابة

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",
    ],
الصورة الرمزية
إهمال
أفضل إجابة

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.

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

 thanks for the answer

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 25
992
2
نوفمبر 24
2200
4
فبراير 24
12358
sale / delivery تم الحل
1
يناير 24
1678
0
مايو 23
1900