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

Qweb comprehension list if date between

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
dateqwebbetweensum
9 Cevaplar
6046 Görünümler
Avatar
Thomas DUPORT

Hello, i'm in odoo 10 in qweb report

I want to browse my invoices records ( <tr t-foreach="docs" t-as="o">)

and i want to sum the total_amount for all invoices where the date_invoice is in january, then for february etc...

I've tried this:

<t t-set="adquat_janvier" t-value="sum([o.amount_total for o in docs if date_invoice in ('20190101','20190131') ])"/>

But there is the following error 

SyntaxError: unexpected EOF while parsing

Error when compiling AST
SyntaxError: unexpected EOF while parsing (<unknown>, line 0)
Template: 1126
Path: /templates/t/t/t/t[2]
Node: <t t-content="True"/>
​
I've tried this too :
<t t-set="adquat_janvier" t-value="sum([(date_invoice in ('20190101','20190131') and o.amount_total)  for o in docs ])"/>

How can i set debug mode ? (with pdb ?) 

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

Ok so I completely change my method : 

I've done a class and a method to teturn all the data I need :


class ReportCalendrierAdherent(models.AbstractModel):
_name = 'report.adquat_distribinox_report.report_calendrier_adherent'

@api.model
def get_report_values(self, docids, data=None):
    ...
    docargs = {
    'doc_ids': docids,
    'doc_model': 'account.invoice',
    'docs': self.env['account.invoice'].browse(docids),
    'arg_partner': invoices[0].partner_id,
    'arg_lines': lines,
    'arg_line_total': line_total,
    }
    return docargs
0
Avatar
Vazgeç
Avatar
Hilar Andikkadavath
En İyi Yanıt

Try this:

<t t-set="adquat_janvier"
t-value="sum([docs.filtered(lambda rec: rec.date_invoice >= datetime.date(2019,1,1) and rec.date_invoice <= datetime.date(2019,1,31)).mapped('amount_total')])"/>
0
Avatar
Vazgeç
Thomas DUPORT
Üretici

Sorry it doesn't whork, this is the error :

Error to render compiling AST

TypeError: unsupported operand type(s) for +: 'int' and 'list'

Template: 1154

Path: /templates/t/t/t/table/tbody/tr/t

Node: <t t-set="adquat_janvier" t-value="sum([docs.filtered(lambda rec: rec.date_invoice in ('20190101','20190131')).mapped('amount_total')])"/>

Hilar Andikkadavath

what are docs here?

Hilar Andikkadavath

you should update rec.date_invoice in ('20190101','20190131') with proper date comparison

Thomas DUPORT
Üretici

docs are account.invoices

how can i do proper date comparison please?

Thomas DUPORT
Üretici

Do you know if i can do all my treatment in python and return the correct values at qweb at the end ?

Hilar Andikkadavath

for example:

str(datetime.date(2019,1,1)) in ('2019-01-01') or datetime.date(2019,1,1) == date(2019,1,1) or datetime.date(2019,1,1) in [datetime.date(2019,1,1),datetime.date(2019,1,2)]

Hilar Andikkadavath

check my updated answer, maybe you need 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
QWeb report : calculate number of days late for task deadlines
date qweb
Avatar
Avatar
Avatar
2
Eki 21
8610
Qweb report compare a field date with today date Çözüldü
date qweb report
Avatar
Avatar
1
Şub 25
2402
how to take purchase order of a partner in between two dates?
date purchase_order between
Avatar
0
Eki 24
3101
Problem with date filter BETWEEN two dates
filter date between v18
Avatar
Avatar
Avatar
2
May 25
2138
How to avoid unicode transformation of my data passed to a report parser? Çözüldü
date qweb format unicode
Avatar
Avatar
2
Şub 16
6882
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