Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Error when clicking on menuitem of custom module

Subscribe

Get notified when there's activity on this post

This question has been flagged
actionsmenuitemcustommoduleOdoo12.0
1 Reply
5084 Views
Avatar
TalllPaul

Hello. 


I am creating a custom module, I have installed my module fine on Odoo 12 and I have added actions and menuitems for my module however, when I click the menu I keep getting an error and I am unsure of how to narrow down where the error is coming from.

ERROR WHEN CLICKIN ON THE MENU:

Error:
Odoo Server Error
Traceback (most recent call last):
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 1049, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 133
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1012, in __get__
    value = record.env.cache.get(record, self)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 1051, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.actions.act_window(133,).search_view', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\pycompat.py", line 87, in reraise
    raise value
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\service\model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 1262, in load
    action = request.env[action_type].browse([action_id]).read()
  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions.py", line 210, in read
    result = super(IrActionsActWindow, self).read(fields, load=load)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 2820, in read
    vals[name] = convert(record[name], record, use_name_get)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 5148, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1016, in __get__
    self.determine_value(record)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1129, in determine_value
    self.compute_value(recs)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1083, in compute_value
    self._compute_value(records)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1074, in _compute_value
    getattr(records, self.compute)()
  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions.py", line 170, in _compute_search_view
    fvg = self.env[act.res_model].fields_view_get(act.search_view_id.id, 'search')
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 1482, in fields_view_get
    xarch, xfields = View.postprocess_and_fields(self._name, etree.fromstring(result['arch']), view_id)
  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1110, in postprocess_and_fields
    fields = Model.fields_get(None)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\models.py", line 2713, in fields_get
    description = field.get_description(self.env)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 770, in get_description
    value = value(env)
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1985, in _description_selection
    return [(value, translate(label) if label else label) for value, label in selection]
  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\fields.py", line 1985, in <listcomp>
    return [(value, translate(label) if label else label) for value, label in selection]
ValueError: too many values to unpack (expected 2)

My XML:

<record model="ir.ui.view" id="alumnos_fp_tree">
      <field name="name">alumnos.fp.tree</field>
      <field name="model">alumnos.fp</field>
      <field name="arch" type="xml">
        <tree>
          <field name="nombre"/>
          <field name="apellidos"/>
          <field name="fecha"/>
          <field name="ciclo"/>
          <field name="nota"/>
        </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="alumnos_fp_form">
      <field name="name">alumnos.fp.form</field>
      <field name="model">alumnos.fp</field>
      <field name="arch" type="xml">
        <form>
        <group colspan="2" col="2">
            <field name="nombre"/>
            <field name="apellidos"/>
            <field name="fecha"/>
            <field name="ciclo"/>
            <field name="nota"/>
          </group>
        </form>
      </field>
    </record>

    <record model="ir.ui.view" id="alumnos_practicas_tree">
      <field name="name">alumnos.practicas.tree</field>
      <field name="model">alumnos.practicas</field>
      <field name="arch" type="xml">
        <tree>
          <field name="nombre"/>
          <field name="direccion"/>
        </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="alumnos_practicas_form">
      <field name="name">alumnos.practicas.form</field>
      <field name="model">alumnos.practicas</field>
      <field name="arch" type="xml">
        <form>
        <group colspan="2" col="2">
            <field name="nombre"/>
            <field name="direccion"/>
          </group>
        </form>
      </field>
    </record>

    <record model="ir.actions.act_window" id="alumnos_fp_action_window">
      <field name="name">Alumnos.fp.action_window</field>
      <field name="res_model">alumnos.fp</field>
      <field name="view_mode">tree,form</field>
    </record>

     <record model="ir.actions.act_window" id="alumnos_practicas_action_window">
      <field name="name">Alumnos.practicas.action_window</field>
      <field name="res_model">alumnos.practicas</field>
      <field name="view_mode">tree, form</field>
    </record>

    <menuitem name="Alumnos" id="alumnos_menu_root"/>

    <menuitem name="Alumnos FP" id="alumnos_fp_menu" parent="alumnos_menu_root" action="alumnos_fp_action_window"/>
    <menuitem name="Practicas" id="alumnos_practicas_menu" parent="alumnos_menu_root" action="alumnos_practicas_action_window"/>

I have checked the views, models and actions in Odoo and it seems they are all created.
0
Avatar
Discard
Jack Dane

Hello Paul,

I can see an error in the code but am unsure whether this produces that error code in V12.

The error I see is the space in "tree, form" for the view_mode of the "alumnos_practicas_action_window" window action.

If this isn't the case, I think there may be an error with a selection field on one of the Python models. Is there any chance you could share the Python code?

Thanks,

Niyas Raphy (Walnut Software Solutions)

If you are new to odoo development see this: https://www.youtube.com/watch?v=3JMEroi4DIk&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=6

Avatar
TalllPaul
Author Best Answer

Hi, Thanks for your help. As suggested Jack, I decided to remove a few fields from model.py and when I remove these three:

    fecha = fields.Date(string="Fecha de nacimiento", help="Elegir tu fecha de nacimiento")
    ciclo = fields.Selection([('DAM'),('DAW'),('ASIR')], string="Ciclo Formativo",default="0")
    nota = fields.Float(string="Nota", help="Introducir tu nota")

The menus load fine, so somewhere in these fields is the error. 


EDIT: Narrowing it down further is seems it was my fields.Selection that was causing the error, if I remove the field it loads. Not sure what the error is though.


EDIT AGAIN: Looks like it is because I wasn't putting the indexes in the selection field. I'm giving it a try now.


SOLUTION: That was the error, I hadn't put the indexes in. Because the error was only shown when I added the actions I was convinced it was the action that was wrong.


Thanks a lot for you help.

0
Avatar
Discard
Jack Dane

Glad you managed to solve this

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Identify the action for the print button on Inventory application Solved
actions Odoo12.0
Avatar
Avatar
1
नव॰ 19
6436
Server actions in menuItem Solved
domain actions menuitem
Avatar
Avatar
Avatar
2
सित॰ 23
6641
Odoo 12 new menu not shown. What's wrong with this code? Solved
menu menuitem Odoo12.0
Avatar
Avatar
Avatar
2
अग॰ 23
29786
How does Odoo's action manager work? Solved
actions menuitem architecture
Avatar
Avatar
1
अप्रैल 23
4025
KeyError: u'ir.actions.menu'
actions menuitem parent
Avatar
Avatar
Avatar
Avatar
3
मार्च 22
10199
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now