Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Create schedule action For sending emails

Naroči se

Get notified when there's activity on this post

This question has been flagged
odoo10
2 Odgovori
6486 Prikazi
Avatar
jenan soliman

Hello,

I want to create schedule action for the button send by email in invoicing for customer every month, How can I do that.


Thanks in advance for any help.

0
Avatar
Opusti
Avatar
D Enterprise
Best Answer

Hi,

The "Send by Email" button on the invoice opens the default email template (like account.email_template_edi_invoice ) and sends the invoice as a PDF attachment to the customer.

Create a Custom Module

Create a simple custom module (eg, auto_invoice_mailer ) and add the following logic.

__manifest__.py

{ 'name' : 'Auto Invoice Email Sender' , 'version' : '1.0' , 'category' : 'Accounting' , 'depends' : [ 'account' ], 'data' : [ 'data/auto_invoice_cron.xml' , ], }

models/auto_invoice.py

from odoo import models, api from datetime import datetime, timedelta class AutoInvoiceSender (models.Model): _inherit = 'account. move' @api.model def cron_send_invoices_by_email ( self ): # Set your criteria for invoices to send (eg, posted, customer invoice, not already sent) invoices = self. search([ ( 'move_type' , '=' , 'out_invoice' ), ( 'state' , '=' , 'posted' ), ( 'invoice_date' , '>=' , (datetime.today() - timedelta(days= 30 )).date()), ( 'invoice_sent' , '=' , False ), # Make sure it's not already sent ]) template = self.env.ref( 'account.email_template_edi_invoice' , raise_if_not_found= False ) for invoice in invoices: if template: invoice.message_post_with_template( template.id ) invoice.write({ 'invoice_sent' : True }) # Mark as sent

data/auto_invoice_cron.xml

<odoo> <data noupdate = "1"> <record id = "ir_cron_auto_invoice_sender" model = "ir.cron"> <field name = "name" >Send Monthly Customer Invoices by Email </field> <field name = "model_id" ref = "account.model_account_move"/> <field name = "state" >code </field> <field name = "code" >model.cron_send_invoices_by_email() </field> <field name = "user_id" ref = "base.user_admin"/> <field name = "interval_number">1 </field> <field name = "interval_type">months </field> <field name = "numbercall" >-1 </field> <field name = "doall" eval = "False"/> <field name = "active" eval = "True"/> </record> </data> </odoo>

i hope it is usefull

0
Avatar
Opusti
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


Create schedule action with the button click function.


<data noupdate="1">


     <record id="ir_cron_scheduler_recurring_action" model="ir.cron">


              <field name="name">Recurring Todo Activity</field>


               <field name="model_id" ref="model_mail_activity"/>


               <field name="state">code</field>


                <field name="code">model.action_done()</field>


                <field name="user_id" ref="base.user_root"/>


                <field name="interval_number">1</field>


                 <field name="interval_type">days</field>


                 <field name="numbercall">-1</field>

     </record>

</data>



Change the interval type as days/months


For creating email template please go through this blog


https://www.cybrosys.com/blog/creating-email-templates-in-odoo-15


Create python function to send email through button function


def action_done(self):

   mail_template = self.env.ref("module_name.email_template_name")

   mail_template_send_mail(self.id,force_send=True)


Hope it helps




0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to send messages that are not shown in chatter? Solved
odoo10
Avatar
Avatar
Avatar
2
okt. 25
8822
How to ORDER BY? [Odoo 10] Solved
odoo10
Avatar
Avatar
2
nov. 24
29726
Dynamic domain functionality - possible to change domain of a field in another model with onchange? (Odoo 10) Solved
odoo10
Avatar
Avatar
Avatar
2
maj 24
8409
Change state of other module
odoo10
Avatar
Avatar
Avatar
Avatar
3
mar. 24
7835
The save button function from the application menu in recruitment is not the same with the save button function on the button from a form link to the applications menu.
odoo10
Avatar
0
mar. 24
2170
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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