Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
4 Vastaukset
41944 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä Paras vastaus

 thanks for the answer

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
toukok. 25
1016
2
marrask. 24
2212
4
helmik. 24
12377
1
tammik. 24
1688
0
toukok. 23
1913