Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
41832 Представления

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
944
2
нояб. 24
2179
4
февр. 24
12304
sale / delivery Решено
1
янв. 24
1666
0
мая 23
1890