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

Is there a way to add "Archive" action to an existing model?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
serveractionTechnicalStudioArchiveSF-Experts
1 Cevapla
12627 Görünümler
Avatar
Harishankar Unnikrishnan (hun)

There are models in Odoo that do not have the "Archive" action under the 'Action' button. Additionally, if we create a new model and do not check the option to allow records to be Archived, can we add it in later? 

0
Avatar
Vazgeç
Niyas Raphy (Walnut Software Solutions)

From code side: https://www.youtube.com/watch?v=aSs0aKsbUqo

Avatar
Harishankar Unnikrishnan (hun)
Üretici En İyi Yanıt

What does “Archive” Action do?

Before we jump into the steps for achieving this, let’s explore what the “Archive” button does. In Odoo, ‘Archive’ is nothing, but a filter based on a Boolean field. Odoo models that have archiving capabilities usually have a field called “Active”, which is a simple Boolean checkbox. Basically, if it is checked, it means that the record is active and if it is unchecked it means the record is not active i.e., archived. When you select a record and archive it, Odoo is unchecking the box for you and then filtering it out. By default, in a model view, you have displayed only the active records, and the archived ones are filtered. When you click on “Filters” and then select the Archived records it basically just shows you all the records that have the checkbox set to FALSE. For models that do not have the archiving function, we are missing this checkbox and some defaults which we can create later. The only step in this that may require direct XML coding will be adding the ribbon that says “Archived” on all the archived records.

Creating the Boolean field

The first step of the process is to create this checkbox that will help us differentiate archived from active records. Do not create this checkbox using studio because the field will be called x_studio_active and that won’t do. We will need to create the field directly on the model itself. 

Go into Settings > Technical > Models, find your model, and add a boolean field named "x_active" (label "Active")

Once you create the field on the model, you must add the field on the form and list views so that we can use it to create the filters.  You can add the field using Studio by simply finding it under “Existing Fields”. You don’t necessarily have to make it visible, as long as it is present in both views. In other models, this field is usually invisible so you can make it invisible after adding it.

Existing Records

If the model you are doing this has existing records, we need to make them active. When we add a new checkbox, Odoo defaults it to be unchecked for all records. This means that all the existing records will have the checkbox set to FALSE (meaning archived). This can be fixed by simply exporting all the existing records with external ID’s and the Active field, setting the Active field to be TRUE, and importing it back in so that all the records now have the Active field checked (hence meaning unarchived). 

Setting User-defined Defaults

For new records that will be created in the model, we need Odoo to automatically check the box. This means that the default for the Active field should be TRUE (checked). We can do this using User-defined Defaults.

Go into Settings > Technical > User-defined default and add a default set to true for the field.

Creating custom Filters for Archived records

We need a preset Filter for displaying all the Archived records. We can do this using Studio.

Open the model – Open Studio – Click on Views and select Search View. Drag a Filter and drop it under ‘Filters’. Label it “Archived” and set a domain on it – Active is not set (false) [["x_active","=",False]]

[OPTIONAL] Adding the Ribbon to Archived Records

We can also add the ribbon widget in the form view, but this can be done only through XML. Open the form view of the model, open studio, click on “View” on the left bar, click on the XML button to open the code and add the following lines of code as the first child of the sheet element in the form view.

Save the XML and exit Studio. You’re all set! 

2
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 to override access rights and record rules in a server action? Çözüldü
serveraction Studio SF-Experts
Avatar
1
Ara 23
3060
How can I create a customer invoice from a task and link it to the task? Çözüldü
Studio SF-Experts
Avatar
1
Eki 25
2533
How can I create a vendor refund from a task and link it to the task? Çözüldü
Studio SF-Experts
Avatar
1
Ağu 24
1771
How can I create a vendor bill from a task and link it to the task? Çözüldü
Studio SF-Experts
Avatar
1
Ağu 24
2523
How can I create a customer credit note from a task and link it to the task? Çözüldü
Studio SF-Experts
Avatar
1
Ağu 24
1984
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