Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Create schedule action For sending emails

Odoberať

Get notified when there's activity on this post

This question has been flagged
odoo10
2 Replies
6488 Zobrazenia
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
Zrušiť
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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How to send messages that are not shown in chatter? Solved
odoo10
Avatar
Avatar
Avatar
2
okt 25
8823
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
máj 24
8411
Change state of other module
odoo10
Avatar
Avatar
Avatar
Avatar
3
mar 24
7837
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
2172
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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