Odoo on button click open popup window and text in it - python

I'm having Odoo workflow with Cancel and Reset buttons. I need that user on these buttons clicks can add a reason.
For that I found sale_cancel_reason app. Example here:
But I need everytime to write new reason, not select from list.
I tied to make many2one relation to wizzard that user everytime can write reason on popup wizzard window:
cancel_id = fields.Many2one('sale.order.cancel', string="Cancellation")
'sale.order.cancel' - wizzard object
But then I got error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/opt/odoo/openerp/service/server.py", line 245, in app
return self.app(e, s)
File "/opt/odoo/openerp/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
File "/opt/odoo/openerp/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
File "/opt/odoo/openerp/http.py", line 1488, in __call__
return self.dispatch(environ, start_response)
File "/opt/odoo/openerp/http.py", line 1462, in __call__
return self.app(environ, start_wrapped)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 588, in __call__
return self.app(environ, start_response)
File "/opt/odoo/openerp/http.py", line 1637, in dispatch
ir_http = request.registry['ir.http']
File "/opt/odoo/openerp/http.py", line 360, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "/opt/odoo/openerp/modules/registry.py", line 354, in get
update_module)
File "/opt/odoo/openerp/modules/registry.py", line 385, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
File "/opt/odoo/openerp/modules/loading.py", line 237, 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/openerp/modules/loading.py", line 137, in load_module_graph
init_module_models(cr, package.name, models)
File "/opt/odoo/openerp/modules/module.py", line 293, in init_module_models
result = obj._auto_init(cr, {'module': module_name})
File "/opt/odoo/openerp/api.py", line 238, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/models.py", line 2625, in _auto_init
self._m2o_fix_foreign_key(cr, self._table, k, dest_model, f.ondelete)
File "/opt/odoo/openerp/api.py", line 238, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/models.py", line 2384, in _m2o_fix_foreign_key
self._m2o_add_foreign_key_checked(source_field, dest_model, ondelete)
File "/opt/odoo/openerp/models.py", line 2324, in _m2o_add_foreign_key_checked
'Many2One relationships from non-transient Model to TransientModel are forbidden'
AssertionError: Many2One relationships from non-transient Model to TransientModel are forbidden
As I understand I can't use Many2one relation with wizzard object. But how else can I make popup window with writable reason field? Is there any ways to do that?

Edit sale_cancel_reason\wizard\cancel_reason_view.xml file and change:
<field name="reason_id" widget="selection"/>
To
<field name="reason_id"/>
Update:
To create a new reason each time you click cancel button use this sale_cancel_reason
changed reason_id (Many2one) to reason (Char)

Related

odoo v11 converter does not exist

all modules has been installed correctly since I restored it from a working backup.
the problem is, it doesn't read properly. does anyone know how to fix this?
2022-02-15 02:40:22,799 31154 ERROR tester werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
execute(self.server.app)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/serving.py", line 193, in execute
application_iter = app(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/service/server.py", line 292, in app
return self.app(e, s)
File "/home/ria/olive/tigernixerp11/odoo/service/wsgi_server.py", line 166, in application
return application_unproxied(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/service/wsgi_server.py", line 154, in application_unproxied
result = handler(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1321, in __call__
return self.dispatch(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1295, in __call__
return self.app(environ, start_wrapped)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 1510, in dispatch
result = ir_http._dispatch()
File "/home/ria/olive/tigernixerp11/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File "/home/ria/olive/tigernixerp11/addons/web_editor/models/ir_http.py", line 22, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/ria/olive/tigernixerp11/addons/http_routing/models/ir_http.py", line 322, in _dispatch
rule, arguments = cls._find_handler(return_rule=True)
File "/home/ria/olive/tigernixerp11/odoo/addons/base/ir/ir_http.py", line 84, in _find_handler
return cls.routing_map().bind_to_environ(request.httprequest.environ).match(return_rule=return_rule)
File "/home/ria/olive/tigernixerp11/odoo/addons/base/ir/ir_http.py", line 238, in routing_map
cls._routing_map = http.routing_map(mods, False, converters=cls._get_converters())
File "/home/ria/olive/tigernixerp11/odoo/http.py", line 988, in routing_map
routing_map.add(werkzeug.routing.Rule(url, endpoint=endpoint, methods=routing['methods'], **kw))
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 1197, in add
rule.bind(self)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 681, in bind
self.compile()
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 731, in compile
_build_regex(self.is_leaf and self.rule or self.rule.rstrip('/'))
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 721, in _build_regex
variable, converter, c_args, c_kwargs)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 689, in get_converter
raise LookupError('the converter %r does not exist' % converter_name)
LookupError: the converter 'str' does not exist
restoring in another computer doesn't seem to have any problem butthis computer seems to be unable to read properly

Can't install own custom modules in Odoo 13

During the last two days I have been trying to install a custom module in Odoo 13. I got the same error over and over again, telling that a column didn't exist in the model that I was creating (the variable in the class did, indeed, exist), I show the error down below.
The python code of the module is the following:
from odoo import models, fields, api
class OfferStage(models.Model):
_name = 'offer.stage'
_description = 'Offer stage'
name = fields.Char()
revisable = fields.Boolean()
sequence = fields.Integer()
modificable = fields.Boolean()
notify_jefe = fields.Boolean()
fold = fields.Boolean()
convertible = fields.Boolean()
notify_personal = fields.Boolean()
notify_jefe_area = fields.Boolean()
And the error I get:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo/odoo/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1331, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1319, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-60>", line 2, in button_immediate_install
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 421, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/odoo/odoo/modules/loading.py", line 313, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/odoo/odoo/modules/loading.py", line 202, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name}, new_install)
File "/opt/odoo/odoo/odoo/modules/registry.py", line 369, in init_models
model._auto_init()
File "/opt/odoo/odoo/odoo/models.py", line 2529, in _auto_init
new = field.update_db(self, columns)
File "/opt/odoo/odoo/odoo/fields.py", line 857, in update_db
self.update_db_notnull(model, column)
File "/opt/odoo/odoo/odoo/fields.py", line 921, in update_db_notnull
sql.drop_not_null(model._cr, model._table, self.name)
File "/opt/odoo/odoo/odoo/tools/sql.py", line 119, in drop_not_null
cr.execute('ALTER TABLE "{}" ALTER COLUMN "{}" DROP NOT NULL'.format(tablename, columnname))
File "/opt/odoo/odoo/odoo/sql_db.py", line 173, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/sql_db.py", line 250, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column "name" of relation "offer_stage" does not exist
After some trial and error, I tried to install a default module that is created with odoo-bin scaffold, and what was my surprise when I cound't install it neither.
The error I get when installing the default module is a collision with other tables of odoo packages, since I am in a test environment I tried removing those packages and, when trying to reinstall, the same error arose but with a different package. I can't figure out why this happens because, a priori, my package only depends on 'base'.
The code of the default module created with scaffold:
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class borrar(models.Model):
_name = 'borrar.borrar'
_description = 'borrar.borrar'
name = fields.Char()
value = fields.Integer()
value2 = fields.Float(compute="_value_pc", store=True)
description = fields.Text()
#api.depends('value')
def _value_pc(self):
for record in self:
record.value2 = float(record.value) / 100
The error I get:
Error:
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo/odoo/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 915, in __call__
return self.method(*args, **kw)
File "/opt/odoo/odoo/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1331, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 1319, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-60>", line 2, in button_immediate_install
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo/odoo/modules/loading.py", line 467, in load_modules
env[model]._check_removed_columns(log=True)
File "/opt/odoo/odoo/odoo/models.py", line 2447, in _check_removed_columns
tools.drop_not_null(cr, self._table, row['attname'])
File "/opt/odoo/odoo/odoo/tools/sql.py", line 119, in drop_not_null
cr.execute('ALTER TABLE "{}" ALTER COLUMN "{}" DROP NOT NULL'.format(tablename, columnname))
File "/opt/odoo/odoo/odoo/sql_db.py", line 173, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo/odoo/odoo/sql_db.py", line 250, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column "rows" of relation "product_packaging" does not exist
However, the table borrar_borrar does get created:
link to image showing table in pgadmin4
This only happens with modules created by me, I have downloaded several modules from github and the official Odoo store and all of them install flawlessly.
Note: for ease of maintenance I have the modules in a git repository and I have soft-linked them to the custom-addons folder in the odoo directory. I have also tried placing them directly in the directory and the errors are the same.
I found out the solution. I'm writing it here in case someone face the same problem in the future.
The issue was that I had a Foreign Data Wrapper (FDW) to read data from another database and, for some reason, it was causing some kind of interference with the database I was working on. When I removed the FDW, everything worked as expected.

Can't Access Database After Editing Views in Odoo 10: Internal Server Error

I'm working on Odoo 10.0 CE (Ubuntu 18.04.1 LTS).
After editing views from Technical (Login Layout - web.login_layout) I set its Inherited View with Web layout - web.layout. I couldnt login to the database & its showing like this (traceback attached below). How to fix this?
I tried to update the database & module through command line as User, but it didnt work, still can't login to the database
Is there any way that i can edit/undo the Views (Web layout - web.layout) through command line (database)?
Thanks :)
500: Internal Server Error
Error
Error message:
load could not load template
Template: web.layout
Traceback
Traceback (most recent call last):
File "/opt/odoo/addons/website/models/ir_http.py", line 274, in _handle_exception
response = super(Http, cls)._handle_exception(exception)
File "/opt/odoo/odoo/addons/base/ir/ir_http.py", line 169, in _handle_exception
return request._handle_exception(exception)
File "/opt/odoo/odoo/http.py", line 775, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/addons/base/ir/ir_http.py", line 195, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo/http.py", line 834, in dispatch
r = self._call_function(**self.params)
File "/opt/odoo/odoo/http.py", line 334, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo/http.py", line 330, in checked_call
result.flatten()
File "/opt/odoo/odoo/http.py", line 1277, in flatten
self.response.append(self.render())
File "/opt/odoo/odoo/http.py", line 1270, in render
return env["ir.ui.view"].render_template(self.template, self.qcontext)
File "/opt/odoo/addons/app_odoo_customize/models/ir_ui_view.py", line 18, in render_template
return super(View, self).render_template(template, values=values, engine=engine)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1049, in render_template
return self.browse(self.get_view_id(template)).render(values, engine)
File "/opt/odoo/addons/website/models/ir_ui_view.py", line 115, in render
return super(View, self).render(values, engine=engine)
File "/opt/odoo/addons/web_editor/models/ir_ui_view.py", line 26, in render
return super(IrUiView, self).render(values=values, engine=engine)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1069, in render
return self.env[engine].render(self.id, qcontext)
File "/opt/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 53, in render
return super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 249, in render
self.compile(template, options)(self, body.append, values or {})
File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 318, in _compiled_fn
raise e
QWebException: None
Traceback (most recent call last):
File "/opt/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 342, in get_template
document = options.get('load', self.load)(template, options)
File "/opt/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 81, in load
template = env['ir.ui.view'].read_template(name)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 944, in read_template
return self._read_template(self.get_view_id(xml_id))
File "<decorator-gen-9>", line 2, in _read_template
File "/opt/odoo/odoo/tools/cache.py", line 87, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 935, in _read_template
arch = self.browse(view_id).read_combined(['arch'])['arch']
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 674, in read_combined
arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 623, in apply_view_inheritance
source = self.apply_inheritance_specs(source, specs_tree, view_id)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 601, in apply_inheritance_specs
self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)
File "/opt/odoo/odoo/addons/base/ir/ir_ui_view.py", line 474, in raise_view_error
raise ValueError(message)
ValueError: Element '<t name="Web layout" t-name="web.layout">' cannot be located in parent view
Error context:
View `Web layout`
[view_id: 165, xml_id: web.layout, model: n/a, parent_id: 166]
load could not load template
Template: web.layout

Error Installation MRO by CodUP module on Odo 12.0

I try to install MRO module but I get this error
Error:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/tools/convert.py", line 757, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 573, in _tag_record
model = self.env[rec_model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'procurement.rule'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/odoo/odoo-server/odoo/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 938, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/odoo/odoo-server/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 749, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 736, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-61>", line 2, in button_immediate_install
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 71, in check_and_log
return method(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 442, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 535, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 426, in load_modules
loaded_modules, update_module, models_to_check)
File "/odoo/odoo-server/odoo/modules/loading.py", line 318, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/odoo/odoo-server/odoo/modules/loading.py", line 224, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/odoo/odoo-server/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/odoo/odoo-server/odoo/tools/convert.py", line 801, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/odoo/odoo-server/odoo/tools/convert.py", line 864, in convert_xml_import
obj.parse(doc.getroot(), mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 754, in parse
self.parse(rec, mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 763, in parse
exc_info[2]
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "/odoo/odoo-server/odoo/tools/convert.py", line 757, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/odoo/odoo-server/odoo/tools/convert.py", line 573, in _tag_record
model = self.env[rec_model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
odoo.tools.convert.ParseError: "procurement.rule" while parsing /odoo/odoo- server/addons/mro/mro_data.xml:59, near
<record id="rule_wh_asset" model="procurement.rule">
<field name="name">WH: Stock -> Asset</field>
<field name="action">move</field>
<field name="picking_type_id" ref="stock.picking_type_internal"/>
<field name="location_src_id" ref="stock.stock_location_stock"/>
<field name="location_id" ref="asset.stock_location_assets"/>
<field name="route_id" ref="mro.route_maintenance"/>
</record>
I installed asset module as dependencies but nothing change
OS Debian 9
same installation but Odoo 11.0
works fine
same installation but Odoo 10.0
works fine
also tried to uninstall, purge and reinstall but nothing change new
Can anyone help me or have any idea to solve the problem pleas
waithing for your reply
thanks
regards
MD
Welcome to Stack Overflow Maudal78!
The procurement.rule has been renamed to stock.rule in Odoo v12. This is why the old code does not work in Odoo 12. See commit https://github.com/odoo/odoo/commit/827958a8902589246dd741341ce1bc5465059909 for details.
You, CodUp team or someone need to make changes to the module for it to be compatible. There already is a branch for Odoo 12.0 in the module’s repo at https://github.com/codup/odoo-eam, but it does not contain changes for this.

Openerp8 startup error: AttributeError: 'bool' object has no attribute 'endswith'

I'm trying to run two instances of OpenERP on the same machine, but whenever I launch the second one it crashes. It is the same user that is launching the two instances of OpenERP and in the same postgresDB but, I launch each instance of OpenERP with different users in the database. Here is the log file I have no idea what is going on here:
Traceback (most recent call last):
File "/home/user/lib/python2.7/Werkzeug-0.9.4-py2.7.egg/werkzeug/serving.py", line 177, in run_wsgi
execute(self.server.app)
File "/home/user/lib/python2.7/Werkzeug-0.9.4-py2.7.egg/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/service/server.py", line 273, in app
return self.app(e, s)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/service/wsgi_server.py", line 215, in application
return application_unproxied(environ, start_response)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/service/wsgi_server.py", line 201, in application_unproxied
result = handler(environ, start_response)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/http.py", line 1097, in __call__
return self.dispatch(environ, start_response)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/http.py", line 1074, in __call__
return self.app(environ, start_wrapped)
File "/home/user/lib/python2.7/Werkzeug-0.9.4-py2.7.egg/werkzeug/wsgi.py", line 579, in __call__
return self.app(environ, start_response)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/http.py", line 1226, in dispatch
ir_http = request.registry['ir.http']
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/http.py", line 220, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/registry.py", line 269, in get
update_module)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/registry.py", line 299, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/loading.py", line 335, in load_modules
force, status, report, loaded_modules, update_module)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/loading.py", line 241, in load_marked_modules
graph.add_modules(cr, module_list, force)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/graph.py", line 99, in add_modules
info = openerp.modules.module.load_information_from_description_file(module)
File "/home/user/openerp-8.0-acmlpsc/openerp8/openerp/modules/module.py", line 180, in load_information_from_description_file
terp_file = opj(mod_path, '__openerp__.py')
File "/usr/local/lib/python2.7/posixpath.py", line 77, in join
elif path == '' or path.endswith('/'):
AttributeError: 'bool' object has no attribute 'endswith'
I hope you can help me.
This may be due to port clash. Try running the instances on different ports, say one on 8069 and the other on 8070.
Try opening the instances in separate Icognito Window (while using chrome), or Private Browsing Window(while using mozilla), because there may be case of one instance overwriting the sessions of another openerp instance.
If this doesn't solve your problem, then I suggest you to pull the latest code of OpenERP8, as still it is not stable.
Hope this helps, do update me with your feedback..

Categories