コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
41923 ビュー

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
990
2
11月 24
2198
4
2月 24
12358
1
1月 24
1678
0
5月 23
1900