Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Generate xlsx report using scheduler (weekly) and email

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
reportxlsx10.0
2 Réponses
7465 Vues
Avatar
rainier

Hello,

I am trying to generate a xlsx report using scheduled actions.

The report saves all sale orders confirmed in a week in a xlsx file.

The report could be generated using print button but not from scheduled action.

Can someone help? 

I have written a method as follows - 

class 

def generate_report(self):

            ret =  self.env['report'].get_action(self, 'so_xlsx')

I have defined the action in xml file.

Thanks in advance!


I could run other simple functions from scheduled action like printing in a logfile.

 

0
Avatar
Ignorer
Avatar
rainier
Auteur Meilleure réponse

Hello Jainesh,

Thank you for your answer. Could you tell me -

1. What is the type of xlsx_report ? ie. What should be returned by  extract_spreadsheet() ?

2.   What exactly happens in following statment ? What is 6 ?
email_template.attachment_ids = [(6, 0, attachment_id.ids)]

Thanks once again!


0
Avatar
Ignorer
Jainesh Shah(Aktiv Software)

Hello Rainier,

This xlsx_report type is .xlsx and the extract_spreadsheet is the function where you can write your report logic(i.e sales order which is confirmed).

Regarding this statement - email_template.attachment_ids = [(6, 0, attachment_id.ids)], You are able to send email with attachment(your xlsx report) and [(6, 0, ids)] is used for appending attachments in email.

Avatar
Jainesh Shah(Aktiv Software)
Meilleure réponse

Hello Rainier,


For sending an xlsx report using scheduled actions you need to follow listed things,


extract_spreadsheet - this is your function where you are creating xlsx report with your logic.


def _cron_send_xlsx(self):

xlsx_report = self.env['object.object'].extract_spreadsheet()

attachment = xlsx_report.get('attachment_id')

attachment_id = self.env['ir.attachment'].browse(attachment)

    email_template = self.env.ref('module_name.email_template')

    email_template.attachment_ids = [(6, 0, attachment_id.ids)]

    email_template.write({'email_from': your_email_from, 

                          'email_to': your_email_to,

    email_template.with_context(ctx).send_mail(

        self.id, raise_exception=False, force_send=True)



Using this way you can send an email with Xlsx report.

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How to add data from different models in a report?
report xlsx odoo
Avatar
Avatar
1
nov. 22
4373
Freeze header column in pivot report
report pivot 10.0
Avatar
Avatar
1
août 21
6833
How to download POS daily sales report in xlsx, csv instead of pdf.
pdf report xlsx Point Of Sale
Avatar
Avatar
1
févr. 25
1622
Insert image in excel using xlsxwriter class. Odoo16 Résolu
report xlsx odoo xlsxwriter
Avatar
Avatar
1
mai 23
5010
Print Excel Report, the use of partner_xlsx('report.res.partner.xlsx', 'res.partner')
report excel xlsx odoo
Avatar
0
déc. 22
5297
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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