Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
41586 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
819
2
พ.ย. 24
2021
4
ก.พ. 24
12134
sale / delivery แก้ไขแล้ว
1
ม.ค. 24
1544
0
พ.ค. 23
1775