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

Calling Activity_feedback in an @api.onchange() causes error.

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
onchangeproject.taskscheduleactivty
1 Cevapla
3584 Görünümler
Avatar
Evan

I want to mark scheduled activities a project task as over if it has been moved to a different stage(stage_id).

Scheduled Activity Creation

def_timesheet_create_task(self, project):
#send notification when task is created
    task = super()._timesheet_create_task(project)
    fornotified_userintask.stage_id.task_create_notified_groups.users:
        task.activity_schedule('mail.mail_activity_data_todo', user_id=notified_user.id)

Scheduled Activity Removal

@api.onchange("stage_id")
def_onchange_stage_id(self):
    self.activity_feedback(['mail.mail_activity_data_todo']) # Completes the acitivity but Throws error. 
It seems like the error is being triggered because the front-end is trying to read mail.message but fails because the mail.activity is gone due to onchange being run before it.

Console output

2022-08-03 02:13:20,600 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /web/dataset/call_kw/project.task/onchange HTTP/1.1" 200 - 120 0.101 0.108

2022-08-03 02:13:20,608 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 11 0.016 7.770

2022-08-03 02:13:20,609 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 12 0.013 7.788

2022-08-03 02:13:20,610 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 11 0.015 7.777

2022-08-03 02:13:20,625 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /web/dataset/call_kw/mail.message/read HTTP/1.1" 200 - 5 0.010 0.006

2022-08-03 02:13:20,655 47312 WARNING odoo-dev4 odoo.http: Record does not exist or has been deleted.

(Record: mail.activity(73,), User: 2) 

0
Avatar
Vazgeç
Avatar
Evan
Üretici En İyi Yanıt

I managed to figure out the issue as well as find a solution. (sort of, i found a way to bypass the root cause)

Problem

If we unlink the activities in the onchange function, the subsequent call which is made to update the record using write(vals) will fail because for some reason vals will include the now-deleted activity.

Solution

Specific to my use case I was able to move the unlink from the onchange method to the write(self,val) method which I overrode.

defwrite(self, vals):
""" override write function so as to remove and re-attach new scheduled activities """
self.activity_feedback(['mail.mail_activity_data_todo']) #remove automated activities attached to task
super().write(vals)
#Add sheduled activities on the new user group
fornotified_userinself.stage_id.task_create_notified_groups.users:
self.activity_schedule('mail.mail_activity_data_todo', user_id=notified_user.id)

Each time the task is editted(using write). It unlinks the activity via activity_feedback() and creates a new one with the new user group computed from the task.

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
AttributeError: 'NoneType' object has no attribute 'values' (Odoo 13)
onchange attributeerror project.task
Avatar
Avatar
Avatar
2
Ara 24
69826
How to restrict that only creators and assignees with permissions can see their own tasks in project?
project.task
Avatar
Avatar
Avatar
2
May 25
3470
Make is_closed field for a task editable
project.task
Avatar
Avatar
Avatar
2
Tem 24
2494
trying to auto correct a wrong users value
onchange
Avatar
Avatar
1
Eki 23
2707
"Wrong value for %s: %r" % (self, value) Çözüldü
onchange
Avatar
Avatar
2
Eki 23
2937
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