İç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

Issue with Tests After Installing the Contacts Module on Odoo 18 (Odoo.sh)

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
modulestestcodeodoo.shOdoo.sh
2 Cevaplar
3637 Görünümler
Avatar
Félicien Catherin

Hi everyone,

I'm using Odoo.sh to build my custom module, but I've encountered an issue with tests.

At first, I thought the problem was with my code. However, after completely removing everything and restarting from a fully empty branch (0 commits), I noticed that the following command works perfectly on a blank database:

odoo-bin --test-enable --stop-after-init --log-level=test

But if I install the Contacts module (via the app installation interface) and rerun the same test command:

odoo-bin --test-enable --stop-after-init --log-level=test

I immediately get many errors like this:

odoo.sql_db: bad query: b'INSERT INTO "res_users" ("active", "company_id", "create_date", "create_uid", "login", "partner_id", "write_date", "write_uid") VALUES (true, 1, '2025-02-15 00:04:13.125900', 1, 'u1', 578, '2025-02-15 00:04:13.125900', 1) RETURNING "id"' ERROR: null value in column "notification_type" of relation "res_users" violates not-null constraint DETAIL: Failing row contains (58, 1, 578, t, 2025-02-15 00:04:13.1259, u1, null, null, 1, 1, null, null, 2025-02-15 00:04:13.1259, null, null, null, null, null).

Example traceback:

odoo.addons.base.tests.test_base: ERROR: TestGroups.test_remove_groups Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/addons/base/tests/test_base.py", line 209, in test_remove_groups u1 = self.env['res.users'].create({'login': 'u1', 'name': 'U1'}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<decorator-gen-32>", line 2, in create File "/home/odoo/src/odoo/odoo/api.py", line 479, in _model_create_multi return create(self, [arg]) ^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/odoo/addons/base/models/res_users.py", line 1901, in create users = super(UsersView, self).create(new_vals_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<decorator-gen-30>", line 2, in create File "/home/odoo/src/odoo/odoo/api.py", line 480, in _model_create_multi return create(self, arg) ^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/odoo/addons/base/models/res_users.py", line 1602, in create return super(UsersImplied, self).create(vals_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<decorator-gen-28>", line 2, in create File "/home/odoo/src/odoo/odoo/api.py", line 480, in _model_create_multi return create(self, arg) ^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/odoo/addons/base/models/res_users.py", line 706, in create users = super(Users, self).create(vals_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<decorator-gen-0>", line 2, in create File "/home/odoo/src/odoo/odoo/api.py", line 480, in _model_create_multi return create(self, arg) ^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/odoo/models.py", line 4975, in create records = self._create(data_list) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/odoo/models.py", line 5159, in _create cr.execute(SQL( File "/home/odoo/src/odoo/odoo/sql_db.py", line 354, in execute res = self._obj.execute(query, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ psycopg2.errors.NotNullViolation: null value in column "notification_type" of relation "res_users" violates not-null constraint DETAIL: Failing row contains (58, 1, 578, t, 2025-02-15 00:04:13.1259, u1, null, null, 1, 1, null, null, 2025-02-15 00:04:13.1259, null, null, null, null, null).

The error seems to be caused by a missing value in the notification_type column when inserting a new user.

Is there an issue with the Contacts module, or am I doing something wrong?

I'm using Odoo 18 on Odoo.sh with the latest revision.

Thanks in advance for your help!


0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,

The issue you're encountering is related to the notification_type field in the res.users model, which is a required field (not null) in Odoo. When creating a new user, this field must be provided, but it seems that the test or the Contacts module is not setting it correctly.


Set a Default Value for notification_type

notification_type = fields.Selection(

        selection=[

            ('email', 'Handle by Emails'),

            ('inbox', 'Handle in Odoo'),

        ],

        default='email',  # Set a default value

        required=True,

    )

Update Existing Users

UPDATE res_users SET notification_type = 'email' WHERE notification_type IS NULL;


Hope it helps

0
Avatar
Vazgeç
Avatar
Sandeep Sonare
En İyi Yanıt

Update all modules once then try it again.

0
Avatar
Vazgeç
Félicien Catherin
Üretici

Thank you for your answer but it is still the same : I cliked update al modules from the online editor and then launched the test again and I still have the same error

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
Odoo.sh - How can I spin up a blank dev branch without the addons?
modules odoo.sh Odoo.sh
Avatar
0
Kas 20
57
Unable to drag builds between branches in Odoo.sh (works on other computers) Çözüldü
odoo.sh Odoo.sh
Avatar
Avatar
1
Eki 25
1149
How can I extend an Odoo.sh staging branch due to expire soon? Çözüldü
odoo.sh Odoo.sh
Avatar
Avatar
2
Kas 25
5287
module working fine on staging but not production on odoo.sh
odoo.sh Odoo.sh
Avatar
Avatar
1
Mar 24
3151
unable to install Odoo module .
modules odoo.sh
Avatar
Avatar
Avatar
2
Mar 24
3392
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