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

Smart search of phone numbers.

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
search12.0
2 Cevaplar
5685 Görünümler
Avatar
Lucas John

Hello everyone!

I have phone numbers in contacts written in different forms, with whitespaces, without, in group of 2 - 3 digits.

How to search in those all forms entering number in search form as one continous string of digits?

Let's say writing in search form - 123456789 i want to get results with phone numbers:

123456789

123 456 789

12 34 56 789

+33 12 34 56 789

etc.

The solution (stupid?) is to add wildcard "%" between each letter in search form - %1%2%3%4%5%6%7%8%9%

But maybe there is another - better solution? :)


0
Avatar
Vazgeç
Jack Dane

Hello Lucas,

Would you prefer to keep the spaces in the numbers? As I have a solution which will remove all spaces, meaning that you wouldn't need the wildcard.

Thanks,

Avatar
Jack Dane
En İyi Yanıt

Yes "stupid proof" is what I specialise in! 

The best way would be to create either an automated action or a onchange event depending on your knowledge of creating Odoo apps you can do an onchange event which will remove all spaces from numbers as soon as they click off the field eg:

(requires creating an external app)

    @api.onchange("phone")
    def remove_spaces_from_phone_number(self):
        for record in self:
            if record.phone:
                record.phone = record.phone.replace(" ", "")

(do the same for mobile)

Or create an automated action in Settings->Tehnical->Automated Action. You would set the fields as Model->Contact, Action To Do->Execute Python Code and put "phone, mobile" in the On Change Fields Trigger. (Also make sure the module "base_automation" is installed. 

(can all be done within Odoo GUI)

The Python code would be: 

if record.phone:
  record["phone"] = record.phone.replace(" ", "")
if record.mobile:
  record["mobile"] = record.mobile.replace(" ", "")

For already existing phone numbers you can then write a scheduled action which would be:

all_contacts = env["res.partner"].search(["|", ("phone", "!=", False), ("mobile", "!=", False)])
for contact in all_contacts:
  if contact.phone:
    contact["phone"] = contact.phone.replace(" ", "")
  if contact.mobile:
    contact["mobile"] = contact.mobile.replace(" ", "")

You can run this once and it should be ok as users can no longer add spaces to numbers, or have this running once a day just incase.

I hope this helps!

1
Avatar
Vazgeç
Lucas John
Üretici

Jack, I chose the solution from the GUI.

I installed base_automation, but I cannot see plase to put triggers - phone, mobile. Where it should be?

Maybe it's needed to somehow restart engine after installing base_automation?

Lucas John
Üretici

UPDATE. I somehow open "Planned Actions" instead of "Automated Action". It looks, that i have no more spaces in phone numbers so... IT WORKS!

Please PM me you address I will send you big beer :)

Jack Dane

Hello Lucas,

When you select Action To Do->Execute Python Code it should be below the field "Apply On".

Thanks,

Avatar
Lucas John
Üretici En İyi Yanıt

Hello Jack,

it depends, i cannot assume that all ODOO users will hold on new rule with entering phone number, does your solution will replace all existing numbers with space-less ones, and eventually remove spaces in number entered in future? In short, is it "stupid proof"? :)

0
Avatar
Vazgeç
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
How do I filter a spreadsheet pivot to the current/previous month
search
Avatar
Avatar
1
Tem 25
1441
Search a message Çözüldü
search
Avatar
Avatar
1
Şub 25
1812
How To Set Char Type Field Only Have Number Input ODOO 12 ?
12.0
Avatar
2
Oca 25
7569
computed fields Çözüldü
12.0
Avatar
Avatar
1
Nis 24
3561
running odoo 12 on ubuntu 22.04 OS, python 3.7, postgresql 15.0
12.0
Avatar
Avatar
1
Ara 23
6329
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