Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
41927 Переглядів

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
992
2
лист. 24
2200
4
лют. 24
12363
sale / delivery Вирішено
1
січ. 24
1680
0
трав. 23
1901