Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help,Install error-----Model 'hr.leave' does not exist in registry. #1

Open
cloud1980 opened this issue Jul 1, 2021 · 6 comments
Open

Comments

@cloud1980
Copy link

My Odoo is the lastest version of 12.
When I install the work_schedule in the new database, it hints that the hr。leave does not exist.

Odoo Server Error
Traceback (most recent call last):
File "/home/dwj/odoo12/src/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/dwj/odoo12/src/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/dwj/odoo12/src/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/dwj/odoo12/src/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/home/dwj/odoo12/src/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/dwj/odoo12/src/odoo/service/model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "/home/dwj/odoo12/src/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/dwj/odoo12/src/odoo/http.py", line 941, in call
return self.method(*args, **kw)
File "/home/dwj/odoo12/src/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/dwj/odoo12/src/addons/web/controllers/main.py", line 967, in call_button
action = self._call_kw(model, method, args, {})
File "/home/dwj/odoo12/src/addons/web/controllers/main.py", line 955, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/dwj/odoo12/src/odoo/api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/home/dwj/odoo12/src/odoo/api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_install
File "/home/dwj/odoo12/src/odoo/addons/base/models/ir_module.py", line 75, in check_and_log
return method(self, *args, **kwargs)
File "/home/dwj/odoo12/src/odoo/addons/base/models/ir_module.py", line 446, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/home/dwj/odoo12/src/odoo/addons/base/models/ir_module.py", line 562, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/dwj/odoo12/src/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/dwj/odoo12/src/odoo/modules/loading.py", line 419, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/dwj/odoo12/src/odoo/modules/loading.py", line 311, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/dwj/odoo12/src/odoo/modules/loading.py", line 188, in load_module_graph
model_names = registry.load(cr, package)
File "/home/dwj/odoo12/src/odoo/modules/registry.py", line 241, in load
model = cls._build_model(self, cr)
File "/home/dwj/odoo12/src/odoo/models.py", line 439, in _build_model
raise TypeError("Model %r does not exist in registry." % name)
TypeError: Model 'hr.leave' does not exist in registry.

@danieldemedziuk
Copy link
Owner

danieldemedziuk commented Jul 1, 2021

Hello @cloud1980 ,
thanks for writing. Indeed such an error occurs. Thanks for reporting it. To resolve the issue, you need to install the module responsible for Leaves [hr.leave] before installing the module - this is the core Odoo HR module.

I will try to make the necessary corrections soon.

Please note that this is not the final version of the module. I am still working on the final version.

Have a nice day! :)

@danieldemedziuk
Copy link
Owner

danieldemedziuk commented Jul 1, 2021

You can now download work_schedule module.

@cloud1980
Copy link
Author

Thanks for your reply soon, danieldemedziuk.
Now, I can install it .
My new question is :
In the menu "schedule", with the list view. I want to create a new schedule, the server error implies that there is a "employee_id"
key error in work_shedule modle ,line 94.
In the source code, employee_id is origion from the hr's Employee class and I have installed hr module.
1

Hello @cloud1980 ,
thanks for writing. Indeed such an error occurs. Thanks for reporting it. To resolve the issue, you need to install the module responsible for Leaves [hr.leave] before installing the module - this is the core Odoo HR module.

I will try to make the necessary corrections soon.

Please note that this is not the final version of the module. I am still working on the final version.

Have a nice day! :)

@danieldemedziuk
Copy link
Owner

Hello @cloud1980
Thanks for reporting the problem. It is indeed necessary to install one more module that solves this problem. I will try to prepare such a module to perfectly fit the schedule. I will post the finished solution on my github. I will try to do it this week. Please be patient with me.

Thank you and best regards
Daniel

@cloud1980
Copy link
Author

Hello @danieldemedziuk
Thank you for your reply. I'm looking forward to your release. I'm also studying the development of odoo. I hope I can communicate with you later.

@danieldemedziuk
Copy link
Owner

Hello @cloud1980
Try download it now. I will be really happy for contacting you later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants