Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Error when clicking on menuitem of custom module

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
actionsmenuitemcustommoduleOdoo12.0
1 Balas
5089 Tampilan
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
Buang
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
Penulis Jawaban Terbai

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
Buang
Jack Dane

Glad you managed to solve this

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Identify the action for the print button on Inventory application Diselesaikan
actions Odoo12.0
Avatar
Avatar
1
Nov 19
6437
Server actions in menuItem Diselesaikan
domain actions menuitem
Avatar
Avatar
Avatar
2
Sep 23
6642
Odoo 12 new menu not shown. What's wrong with this code? Diselesaikan
menu menuitem Odoo12.0
Avatar
Avatar
Avatar
2
Agu 23
29787
How does Odoo's action manager work? Diselesaikan
actions menuitem architecture
Avatar
Avatar
1
Apr 23
4025
KeyError: u'ir.actions.menu'
actions menuitem parent
Avatar
Avatar
Avatar
Avatar
3
Mar 22
10199
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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