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

Model Code:

from odoo import models, fields, api



class ResUsersInherit(models.Model):

    _inherit = 'res.users'

    _description = 'Inherited res_users'


    supervisor = fields.Many2one('res.users', string='Supervisor',

                                 domain=lambda self: [('id', '!=', self.env.user.id)])


i have added this inherit_user.py file in models/__init__.py


when restart odoo17 service, got below error in odoo.log 

ERROR: column res_users.supervisor does not exist

LINE 1: ...res_users"."write_uid", "res_users"."write_date", "res_users...


is there any change in ver. 17.0 to inherit or error is in my Model above?

please help.

regards


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

Hi,

Try to upgrade module by command line.
Add -u module_name -d db_name in odoo configuration

Ảnh đại diện
Huỷ bỏ
Tác giả

thank you @Sahar for help.
i run odoo service manually as per your instruction and it worked fine.
regards

Câu trả lời hay nhất

Hi Smithjohn45,

I think you working with odoo17 and windows os i think

based on my case you need to first kill service then run so model migrate i have same issue when i am use Windows 10.

In linux os not issue.

Ảnh đại diện
Huỷ bỏ
Tác giả

thank you @Nikhil for reply.
yes, OS is Windows 10 and Odoo ver is 17 which already have mentioned. so many times i stop service and tried the things in different ways but failed yet.
when we add / update a Model (python file) we have to restart service, when i am trying to restart, it is throwing error which already mentioned in my opening post. how i can migrate the model?

Câu trả lời hay nhất

Hi,

Activate debug mode,

Go to apps -> select the custom module-> Upgrade custom module


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

kindly check my opening post, clearly mentioned that "when restart odoo17 service, got below error in odoo.log" and posted the error below it... how i can get debug/developer mode?
hope you will read the post carefully.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 24
1410
1
thg 3 24
1272
4
thg 5 25
2129
2
thg 5 25
5470
1
thg 3 25
1371