Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
41558 Zobrazení

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)

Avatar
Zrušit
Nejlepší odpověď

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",
    ],
Avatar
Zrušit
Nejlepší odpověď

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.

Avatar
Zrušit
Autor Nejlepší odpověď

 thanks for the answer

Avatar
Zrušit
Nejlepší odpověď

It's dependency issue, added sale dependency on your custom module

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 25
799
2
lis 24
2005
4
úno 24
12085
1
led 24
1532
0
kvě 23
1758