I got an error while trying to reinstall my modulo, I think that was not the error.
I was reviewing other modules and could be that I typed something for error but the error does not appear in my editor and in the console just show the KeyError: '\x7f'
Traceback (most recent call last):
File "/home/cristian/odoo_practice/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/home/cristian/odoo_practice/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/home/cristian/odoo_practice/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/cristian/odoo_practice/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/cristian/odoo_practice/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/home/cristian/odoo_practice/odoo/http.py", line 912, in __call__
return self.method(*args, **kw)
File "/home/cristian/odoo_practice/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/home/cristian/odoo_practice/addons/web/controllers/main.py", line 1398, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/home/cristian/odoo_practice/addons/web/controllers/main.py", line 1386, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/cristian/odoo_practice/odoo/api.py", line 399, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/cristian/odoo_practice/odoo/api.py", line 386, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-72>", line 2, in button_immediate_install
File "/home/cristian/odoo_practice/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/home/cristian/odoo_practice/odoo/addons/base/models/ir_module.py", line 475, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/home/cristian/odoo_practice/odoo/addons/base/models/ir_module.py", line 593, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/cristian/odoo_practice/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/cristian/odoo_practice/odoo/modules/loading.py", line 459, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/cristian/odoo_practice/odoo/modules/loading.py", line 347, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/cristian/odoo_practice/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/home/cristian/odoo_practice/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/home/cristian/odoo_practice/odoo/tools/convert.py", line 729, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "/home/cristian/odoo_practice/odoo/tools/convert.py", line 771, in convert_csv_import
result = env[model].load(fields, datas)
File "/home/cristian/odoo_practice/odoo/models.py", line 1010, in load
if isinstance(model_fields[field_path[0]], odoo.fields.Many2one):
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/cristian/odoo_practice/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/cristian/odoo_practice/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
KeyError: '\x7f'```
Can somebody help me :(. Im learning to use Odoo
Related
I created 2 custom modules, "projects" and "laboratory".
Laboratory module has one2many field of projects.
Project module has many2one field of laboratory id.
I made some modification of "laboratory" module and when I tried update it I get this error:
Traceback (most recent call last):
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "C:\Odoo13\Odoo 13.0\server\odoo\tools\pycompat.py", line 14, in reraise
raise value
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 915, in __call__
return self.method(*args, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 515, in response_wrap
response = f(*args, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1326, in call_button
action = self._call_kw(model, method, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1314, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-65>", line 2, in button_immediate_upgrade
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 634, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 419, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 315, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 202, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name}, new_install)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 348, in init_models
model._auto_init()
File "C:\Odoo13\Odoo 13.0\server\odoo\models.py", line 2482, in _auto_init
new = field.update_db(self, columns)
File "C:\Odoo13\Odoo 13.0\server\odoo\fields.py", line 2417, in update_db
comodel = model.env[self.comodel_name]
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 463, in __getitem__
return self.registry[model_name]._browse(self, (), ())
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 177, in __getitem__
return self.models[model_name]
KeyError: 'projects'
As I googled this error, it seems that I didn't put dependencies of my module "projects".
So, next step was put dependencies:
# any module necessary for this one to work correctly
'depends': ['base','mail','projects'],
And now I get another error which is saying about dependencies on it self:
Odoo Server Error
Traceback (most recent call last):
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "C:\Odoo13\Odoo 13.0\server\odoo\tools\pycompat.py", line 14, in reraise
raise value
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 915, in __call__
return self.method(*args, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\http.py", line 515, in response_wrap
response = f(*args, **kw)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1326, in call_button
action = self._call_kw(model, method, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1314, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-66>", line 2, in button_immediate_upgrade
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 634, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "C:\Odoo13\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 419, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 315, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\loading.py", line 176, in load_module_graph
registry.setup_models(cr)
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 255, in setup_models
model._setup_fields()
File "C:\Odoo13\Odoo 13.0\server\odoo\models.py", line 2690, in _setup_fields
field.setup_full(self)
File "C:\Odoo13\Odoo 13.0\server\odoo\fields.py", line 431, in setup_full
self._setup_regular_full(model)
File "C:\Odoo13\Odoo 13.0\server\odoo\fields.py", line 2897, in _setup_regular_full
comodel = model.env[self.comodel_name]
File "C:\Odoo13\Odoo 13.0\server\odoo\api.py", line 463, in __getitem__
return self.registry[model_name]._browse(self, (), ())
File "C:\Odoo13\Odoo 13.0\server\odoo\modules\registry.py", line 177, in __getitem__
return self.models[model_name]
KeyError: 'laboratory'
And when I change dependency and add self module like this:
# any module necessary for this one to work correctly
'depends': ['base','mail','projects','laboratory'],
I am getting 500 Internal Server Error.
Could somebody explain why it happens and how I can handle it?
Reason
It is because of "circular dependency". Module "projects" depend on "laboratory". But "laboratory" depend "projects" and it become loop. As a result, module upgrades are not finished, fields are not added and KeyError will be shown. Check those modules in Apps, those will be stuck with only "Cancel Upgrade" button. I am testing this on odoo 11.
Fix
I can think of a few ways to solve this problem.
Move both "project" and "laboratory" models to same module.
Use "many2many" field instead.
Create another module that depend on both modules and define "one2many" and "many2one" here by inheritance.
Move one field to another module by inheritance. I mean, for e.g. inherit "Laboratory" and add "projects" field in "Projects" module.
I'm inherit mail thread and after click on new message get this error:
Odoo Server Error
Traceback (most recent call last):
File "/home/pc/git/odoo/openerp/http.py", line 648, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/pc/git/odoo/openerp/http.py", line 685, in dispatch
result = self._call_function(**self.params)
File "/home/pc/git/odoo/openerp/http.py", line 321, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/pc/git/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/home/pc/git/odoo/openerp/http.py", line 314, in checked_call
result = self.endpoint(*a, **kw)
File "/home/pc/git/odoo/openerp/http.py", line 964, in __call__
return self.method(*args, **kw)
File "/home/pc/git/odoo/openerp/http.py", line 514, in response_wrap
response = f(*args, **kw)
File "/home/pc/git/odoo/addons/web/controllers/main.py", line 888, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/pc/git/odoo/addons/web/controllers/main.py", line 880, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/home/pc/git/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/home/pc/git/odoo/openerp/api.py", line 381, in old_api
result = method(recs, *args, **kwargs)
File "/home/pc/git/odoo/addons/mail/models/mail_thread.py", line 1473, in message_get_suggested_recipients
if not obj.user_id or not obj.user_id.partner_id:
AttributeError: 'res.partner' object has no attribute 'partner_id'
In openerp is added 'depends' : ['base', 'web', 'website','hr','mail'],
in model is added: _inherit = ['mail.thread', 'ir.needaction_mixin']
Where is problem, and what is name od table where is message store?
In class I'm change field name:
user_id = fields.Many2one('res.partner')
to
partner_id = fields.Many2one('res.partner')
I'am trying to define my own operation in tensorflow using the #function.Defun decorator, because i need to equip it with a custom gradient. However, in my code i also needs to call the tf.map_fn function, to apply a specific function to a batch of data. For simplicity i am trying to do something like:
def add_func(x):
return x+1
#function.Defun(tf.float32)
def test(a):
return tf.map_fn(add, a)
with tf.Session() as sess:
a = tf.ones(shape=(6,1))
res = sess.run(test(a))
This code runs fine without the #function.Defun decorator, but using the decorator I get the the following error:
InvalidArgumentError: 25 nodes in a cycle
[[Node: test_8028ca0d_2 = test_8028ca0d[_device="/job:localhost/replica:0/task:0/cpu:0"](ones_4)]]
Caused by op 'test_8028ca0d_2', defined at:
File "C:\Users\Nicki\Anaconda3\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 223, in <module>
main()
File "C:\Users\Nicki\Anaconda3\lib\site-packages\spyder\utils\ipython\start_kernel.py", line 219, in main
kernel.start()
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\kernelapp.py", line 474, in start
ioloop.IOLoop.instance().start()
File "C:\Users\Nicki\Anaconda3\lib\site-packages\zmq\eventloop\ioloop.py", line 177, in start
super(ZMQIOLoop, self).start()
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tornado\ioloop.py", line 887, in start
handler_func(fd_obj, events)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tornado\stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "C:\Users\Nicki\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\zmq\eventloop\zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tornado\stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 276, in dispatcher
return self.dispatch_shell(stream, msg)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 228, in dispatch_shell
handler(stream, idents, msg)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\kernelbase.py", line 390, in execute_request
user_expressions, allow_stdin)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\ipkernel.py", line 196, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\ipykernel\zmqshell.py", line 501, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2717, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2827, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\Nicki\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-19-c5e48d04d428>", line 1, in <module>
runfile('C:/Users/Nicki/.spyder-py3/temp.py', wdir='C:/Users/Nicki/.spyder-py3')
File "C:\Users\Nicki\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Nicki/.spyder-py3/temp.py", line 156, in <module>
res = sess.run(test(a))
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 618, in __call__
return _call(self._definition.signature, *args, **kwargs)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tensorflow\python\framework\function.py", line 271, in _call
compute_shapes=False)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Users\Nicki\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in __init__
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): 25 nodes in a cycle
[[Node: test_8028ca0d_2 = test_8028ca0d[_device="/job:localhost/replica:0/task:0/cpu:0"](ones_4)]]
Just to close the loop on this question, the discussion on GitHub revealed that the problem exists in an older version of TensorFlow (0.12 or earlier). Upgrading to TensorFlow 1.0 fixes the problem.
an error while creating new reservation in hotel reservation module in odoo V8
error says
ValueError: "global name 'cr' is not defined" while evaluating
u'set_to_draft_reservation()'
while creating variable cr in the method and assign self.env.cr to it
to define it
an error says
multi-value for variable cr
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/openerp/http.py", line 543, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/openerp/http.py", line 580, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/openerp/http.py", line 316, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/openerp/http.py", line 313, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/openerp/http.py", line 809, in __call__
return self.method(*args, **kw)
File "/opt/odoo/openerp/http.py", line 409, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 944, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 372, in old_api
result = method(recs, *args, **kwargs)
File "/opt/odoo/addons/hotel_reservation/models/hotel_reservation.py", line 518, in create
return super(HotelReservation, self).create(vals)
File "/opt/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 508, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/opt/odoo/addons/mail/mail_thread.py", line 381, in create
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
File "/opt/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 372, in old_api
result = method(recs, *args, **kwargs)
File "/opt/odoo/openerp/models.py", line 4100, in create
record = self.browse(self._create(old_vals))
File "/opt/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 508, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/opt/odoo/openerp/models.py", line 4326, in _create
self.create_workflow(cr, user, [id_new], context=context)
File "/opt/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/models.py", line 3546, in create_workflow
workflow.trg_create(uid, self._name, res_id, cr)
File "/opt/odoo/openerp/workflow/__init__.py", line 73, in trg_create
return WorkflowService.new(cr, uid, res_type, res_id).create()
File "/opt/odoo/openerp/workflow/service.py", line 81, in create
WorkflowInstance.create(self.session, self.record, wkf_id)
File "/opt/odoo/openerp/workflow/instance.py", line 54, in create
WorkflowItem.create(session, record, activity, instance_id, stack)
File "/opt/odoo/openerp/workflow/workitem.py", line 95, in create
workflow_item.process(stack=stack)
File "/opt/odoo/openerp/workflow/workitem.py", line 116, in process
if not self._execute(activity, stack):
File "/opt/odoo/openerp/workflow/workitem.py", line 162, in _execute
returned_action = self.wkf_expr_execute(activity)
File "/opt/odoo/openerp/workflow/workitem.py", line 313, in wkf_expr_execute
return self.wkf_expr_eval_expr(activity['action'])
File "/opt/odoo/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr
result = eval(line, env, nocopy=True)
File "/opt/odoo/openerp/tools/safe_eval.py", line 314, in safe_eval
return eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/opt/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/addons/hotel_reservation/models/hotel_reservation.py", line 321, in set_to_draft_reservation
self.delete_workflow(cr, uid, [reservation.id])
ValueError: "global name 'cr' is not defined" while evaluating
u'set_to_draft_reservation()'
the method causing error
#api.multi
def set_to_draft_reservation(self):
for reservation in self:
reservation.write({'state':'draft'})
# Deleting the existing instance of workflow for PO
self.delete_workflow(self._cr, self._uid, [reservation.id])
self.create_workflow(cr, uid, [reservation.id])
return True
Always I'm getting errors while installing modules on the Odoo 8 server, following is the error message. OpenERP Server Error:
Traceback (most recent call last): File
"/opt/odoo/odoo-server/openerp/http.py", line 476, in
_handle_exception return super(JsonRequest, self)._handle_exception(exception) File
"/opt/odoo/odoo-server/openerp/http.py", line 495, in dispatch result
= self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 311, in _call_function
return checked_call(self.db, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/http.py", line 308, in checked_call
return self.endpoint(*a, **kw) File
"/opt/odoo/odoo-server/openerp/http.py", line 685, in __call__ return
self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py",
line 360, in response_wrap response = f(*args, **kw) File
"/opt/odoo/odoo-server/addons/web/controllers/main.py", line 987, in
call_button action = self._call_kw(model, method, args, {}) File
"/opt/odoo/odoo-server/addons/web/controllers/main.py", line 975, in
_call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/api.py", line 204, in wrapper return
old_api(self, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line
450, in button_immediate_install return
self._button_immediate_function(cr, uid, ids, self.button_install,
context=context) File "/opt/odoo/odoo-server/openerp/api.py", line
204, in wrapper return old_api(self, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line
497, in _button_immediate_function registry =
openerp.modules.registry.RegistryManager.new(cr.dbname,
update_module=True) File
"/opt/odoo/odoo-server/openerp/modules/registry.py", line 322, in new
openerp.modules.load_modules(registry._db, force_demo, status,
update_module) File
"/opt/odoo/odoo-server/openerp/modules/loading.py", line 357, in
load_modules loaded_modules, update_module) File
"/opt/odoo/odoo-server/openerp/modules/loading.py", line 263, in
load_marked_modules loaded, processed = load_module_graph(cr, graph,
progressdict, report=report, skip_modules=loaded_modules,
perform_checks=perform_checks) File
"/opt/odoo/odoo-server/openerp/modules/loading.py", line 162, in
load_module_graph registry.setup_models(cr) File
"/opt/odoo/odoo-server/openerp/modules/registry.py", line 165, in
setup_models model._setup_fields(cr, SUPERUSER_ID) File
"/opt/odoo/odoo-server/openerp/api.py", line 204, in wrapper return
old_api(self, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/api.py", line 297, in old_api result =
method(recs, *args, **kwargs) File
"/opt/odoo/odoo-server/openerp/models.py", line 2961, in _setup_fields
field.setup(self.env) File "/opt/odoo/odoo-server/openerp/fields.py",
line 360, in setup self._setup(env) File
"/opt/odoo/odoo-server/openerp/fields.py", line 378, in _setup field =
dep_model._fields[field_name] KeyError: 'section_id'
Can anyone help me to resolve this problem?
OS spec: Ubuntu 14.04 LTS