Skip to Content
Menu
This question has been flagged
1 Reply
1820 Views

I am trying to create a simple action for a menu item like below


I also got these simple menus that are related to the menu above:



But apparently odoo doesnt recognize the action I have creted and shows this error like below :
RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 556, in _tag_root

    f(rec)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 339, in _tag_menuitem

    menu = self.env['ir.ui.menu']._load_records([data], self.mode == 'update')

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\models.py", line 5064, in _load_records

    data['record']._load_records_write(data['values'])

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\models.py", line 4995, in _load_records_write

    self.write(values)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\addons\base\models\ir_ui_menu.py", line 176, in write

    return super(IrUiMenu, self).write(values)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\models.py", line 4424, in write

    field.write(self, value)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\fields.py", line 1121, in write

    cache_value = self.convert_to_cache(value, records)

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\fields.py", line 2879, in convert_to_cache

    raise ValueError("Wrong value for %s: %r" % (self, value))

ValueError: Wrong value for ir.ui.menu.action: 'ir.actions.act.window,433'


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\http.py", line 1783, in _serve_db

    return service_model.retrying(self._serve_ir_http, self.env)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\service\model.py", line 133, in retrying

    result = func()

             ^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\http.py", line 1810, in _serve_ir_http

    response = self.dispatcher.dispatch(rule.endpoint, args)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\http.py", line 2014, in dispatch

    result = self.request.registry['ir.http']._dispatch(endpoint)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\users\user\downloads\odoo-17.0\addons\website\models\ir_http.py", line 235, in _dispatch

    response = super()._dispatch(endpoint)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\addons\base\models\ir_http.py", line 222, in _dispatch

    result = endpoint(**request.params)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\http.py", line 759, in route_wrapper

    result = endpoint(self, *args, **params_ok)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\users\user\downloads\odoo-17.0\addons\web\controllers\dataset.py", line 28, in call_button

    action = self._call_kw(model, method, args, kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\users\user\downloads\odoo-17.0\addons\web\controllers\dataset.py", line 20, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\api.py", line 468, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\api.py", line 453, in _call_kw_multi

    result = method(recs, *args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\venv\Lib\site-packages\decorator.py", line 232, in fun

    return caller(func, *(extras + args), **kw)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\addons\base\models\ir_module.py", line 75, in check_and_log

    return method(self, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\addons\base\models\ir_module.py", line 657, in button_immediate_upgrade

    return self._button_immediate_function(self.env.registry[self._name].button_upgrade)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\addons\base\models\ir_module.py", line 590, in _button_immediate_function

    registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\venv\Lib\site-packages\decorator.py", line 232, in fun

    return caller(func, *(extras + args), **kw)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\func.py", line 87, in locked

    return func(inst, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\modules\registry.py", line 114, in new

    odoo.modules.load_modules(registry, force_demo, status, update_module)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\modules\loading.py", line 476, in load_modules

    processed_modules += load_marked_modules(env, graph,

                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\modules\loading.py", line 364, in load_marked_modules

    loaded, processed = load_module_graph(

                        ^^^^^^^^^^^^^^^^^^

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\modules\loading.py", line 227, in load_module_graph

    load_data(env, idref, mode, kind='data', package=package)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\modules\loading.py", line 71, in load_data

    tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 627, in convert_file

    convert_xml_import(env, module, fp, idref, mode, noupdate)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 693, in convert_xml_import

    obj.parse(doc.getroot())

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 613, in parse

    self._tag_root(de)

  File "C:\Users\USER\Downloads\odoo-17.0\odoo\tools\convert.py", line 569, in _tag_root

    raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (

odoo.tools.convert.ParseError: while parsing file:/c:/users/user/downloads/odoo-17.0/custom_addons/om_hotel/views/customer_view.xml:22, somewhere inside

<menuitem id="menu_customer" name="Customer" parent="menu_customer_master" action="action1_hotel_customer" sequence="0"/>


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPC_ERROR

        at makeErrorFromResponse (http://localhost:8017/web/assets/debug/web.assets_web.js:27903:19) (/web/static/src/core/network/rpc_service.js:37)

        at XMLHttpRequest.<anonymous> (http://localhost:8017/web/assets/debug/web.assets_web.js:27951:27) (/web/static/src/core/network/rpc_service.js:85)




***Also, the file is properly added to the __manifest__.py file*** 
Could someone please help?

Avatar
Discard
Best Answer

The error may arises from the following reasons:-
1. In __manifest__.py, if the parent menu file is mentioned after the sub menu file then load parent menu file before sub menu file like this:-

'data': [

    'views/parent_menu_file.xml', 

    'views/sub_menu_file.xml',  ],

2. If the parent menu is defined in another module (e.g., hotel_base), you must prefix the XML ID with the module name.

<menuitem

    id="menu_customer"

    name="Customer"

    parent="hotel_base.menu_customer_master" 

    action="action1_hotel_customer"

    sequence="0"

/>

3. Delete <field name="type">ir.actions.act_window</field> from the action. The model="ir.actions.act_window" already defines the type.


Best Regards,
NIZAMUDHEEN MJ
Accurates


Avatar
Discard
Related Posts Replies Views Activity
0
Dec 24
716
1
Jul 22
1590
2
Jun 20
6022
4
Oct 19
33037
0
Jan 18
4575