跳至內容
選單
此問題已被標幟
4 回覆
41948 瀏覽次數

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
5月 25
1019
2
11月 24
2213
4
2月 24
12381
1
1月 24
1690
0
5月 23
1914