Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
41916 Lượt xem

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)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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",
    ],
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

 thanks for the answer

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
990
2
thg 11 24
2198
4
thg 2 24
12355
sale / delivery Đã xử lý
1
thg 1 24
1678
0
thg 5 23
1900