İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Error when clicking on menuitem of custom module

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
actionsmenuitemcustommoduleOdoo12.0
1 Cevapla
5099 Görünümler
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
Vazgeç
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
Üretici En İyi Yanıt

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
Vazgeç
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!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Identify the action for the print button on Inventory application Çözüldü
actions Odoo12.0
Avatar
Avatar
1
Kas 19
6445
Server actions in menuItem Çözüldü
domain actions menuitem
Avatar
Avatar
Avatar
2
Eyl 23
6649
Odoo 12 new menu not shown. What's wrong with this code? Çözüldü
menu menuitem Odoo12.0
Avatar
Avatar
Avatar
2
Ağu 23
29789
How does Odoo's action manager work? Çözüldü
actions menuitem architecture
Avatar
Avatar
1
Nis 23
4029
KeyError: u'ir.actions.menu'
actions menuitem parent
Avatar
Avatar
Avatar
Avatar
3
Mar 22
10200
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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