跳至内容
菜单
此问题已终结
4 回复
41789 查看

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
914
2
11月 24
2146
4
2月 24
12274
1
1月 24
1651
0
5月 23
1872