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č

Send invoice email via XMLRPC with Ripcord in PHP (ODOO VERSION 11)

Naroči se

Get notified when there's activity on this post

This question has been flagged
invoiceemailaccount.invoicesendmailsending mail with attachment
1 Odgovori
4743 Prikazi
Avatar
Sendy Hartanto

i try to send invoice email via XMLRPC with Ripcord in PHP.. i find something like https://www.odoo.com/id_ID/forum/help-1/send-invoice-mail-from-python-code-148921

but, it using Python

Any ideas how to send invoice email via XMLRPC with Ripcord in PHP?


i already try this :

$send_email_button = $object->execute_kw( 
            $this->db,
            $login,
            $request->password,
            'account.invoice',
            'action_invoice_sent',
            [
                (int)$id
            ]
        );


but it just return some invoice data template


and i try this to send the email :

$send_email = $object->execute_kw( 
            $this->db,
            $login,
            $request->password,
            'mail.compose.message',
            'send_mail',
            [$send_email_button['context']]


but it just return error like this :

{
    "faultCode": 1,
    "faultString": "Traceback (most recent call last):\n  File \"/odoo/odoo-server/odoo/fields.py\", line 940, in __get__\n    value = record.env.cache.get(record, self)\n  File \"/odoo/odoo-server/odoo/api.py\", line 967, in get\n    value = self._data[key][field][record._ids[0]]\nKeyError: 'default_use_template'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/odoo/odoo-server/odoo/service/wsgi_server.py\", line 124, in wsgi_xmlrpc\n    result = odoo.http.dispatch_rpc(service, method, params)\n  File \"/odoo/odoo-server/odoo/http.py\", line 118, in dispatch_rpc\n    result = dispatch(method, params)\n  File \"/odoo/odoo-server/odoo/service/model.py\", line 39, in dispatch\n    res = fn(db, uid, *params)\n  File \"/odoo/odoo-server/odoo/service/model.py\", line 153, in execute_kw\n    return execute(db, uid, obj, method, *args, **kw or {})\n  File \"/odoo/odoo-server/odoo/service/model.py\", line 97, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/odoo/odoo-server/odoo/service/model.py\", line 160, in execute\n    res = execute_cr(cr, uid, obj, method, *args, **kw)\n  File \"/odoo/odoo-server/addons/smile_perf_analyzer/models/service.py\", line 16, in execute_cr\n    res = profile(native_execute_cr)(cr, uid, obj, method, *args, **kw)\n  File \"/odoo/odoo-server/addons/smile_perf_analyzer/tools/decorators.py\", line 26, in wrapper\n    return func(*args, **kwargs)\n  File \"/odoo/odoo-server/odoo/service/model.py\", line 149, in execute_cr\n    return odoo.api.call_kw(recs, method, args, kw)\n  File \"/odoo/odoo-server/odoo/api.py\", line 689, in call_kw\n    return call_kw_multi(method, model, args, kwargs)\n  File \"/odoo/odoo-server/odoo/api.py\", line 680, in call_kw_multi\n    result = method(recs, *args, **kwargs)\n  File \"/odoo/odoo-server/addons/purchase/models/purchase.py\", line 1151, in send_mail\n    return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)\n  File \"/odoo/odoo-server/addons/sale/wizard/mail_compose_message.py\", line 17, in send_mail\n    return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)\n  File \"/odoo/odoo-server/addons/account/models/account_invoice.py\", line 1846, in send_mail\n    return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)\n  File \"/odoo/odoo-server/addons/mail/wizard/mail_compose_message.py\", line 205, in send_mail\n    if wizard.attachment_ids and wizard.composition_mode != 'mass_mail' and wizard.template_id:\n  File \"/odoo/odoo-server/odoo/fields.py\", line 944, in __get__\n    self.determine_value(record)\n  File \"/odoo/odoo-server/odoo/fields.py\", line 1045, in determine_value\n    record._prefetch_field(self)\n  File \"/odoo/odoo-server/odoo/models.py\", line 2653, in _prefetch_field\n    result = records.read([f.name for f in fs], load='_classic_write')\n  File \"/odoo/odoo-server/addons/mail/models/mail_message.py\", line 800, in read\n    self.check_access_rule('read')\n  File \"/odoo/odoo-server/addons/mail/wizard/mail_compose_message.py\", line 147, in check_access_rule\n    return super(MailComposer, self).check_access_rule(operation)\n  File \"/odoo/odoo-server/addons/mail/models/mail_message.py\", line 620, in check_access_rule\n    WHERE m.id = ANY (%%(ids)s)\"\"\" % self._table, dict(pid=self.env.user.partner_id.id, ids=self.ids))\n  File \"/odoo/odoo-server/addons/smile_perf_analyzer/tools/decorators.py\", line 45, in wrapper\n    return func(self, query, params, log_exceptions)\n  File \"/odoo/odoo-server/odoo/sql_db.py\", line 155, in wrapper\n    return f(self, *args, **kwargs)\n  File \"/odoo/odoo-server/odoo/sql_db.py\", line 232, in execute\n    res = self._obj.execute(query, params)\npsycopg2.ProgrammingError: operator does not exist: integer = text\nLINE 16:                 WHERE m.id = ANY (ARRAY['default_use_templat...\n                                    ^\nHINT:  No operator matches the given name and argument types. You might need to add explicit type casts.\n\n"
}


0
Avatar
Opusti
Avatar
Sendy Hartanto
Avtor Best Answer

Nevermind,


I try another way with Odoo Custom Module, i create odoo custom module and create Class that contain function like this : 


class AccountInvoice(models.Model):

        _inherit = 'account.invoice'

        @api.multi

        def send_invoice_email(self):

                template = self.env.ref('account.email_template_edi_invoice')

                template.send_mail(self.id, force_send=True)

                return True



and call this in PHP Ripcord :

$send_email = $object->execute_kw( 
            $this->db,
            $login,
            $request->password,
            'account.invoice',
            'send_invoice_email',  
            [
                (int)$invoice_id
            ]
        );
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 Invoice to All Account Contacts
accounting invoice contacts account.invoice sending mail with attachment
Avatar
0
apr. 22
3343
cant send email because of ValueError: invalid literal for int() with base 10: '${object.partner_id.id}' Solved
email sendmail
Avatar
Avatar
2
jan. 25
9354
Odoo10: very simple example for sending email via Python
email sendmail
Avatar
Avatar
Avatar
2
jan. 20
15166
send multiple invoice via e-mail
invoice email
Avatar
Avatar
Avatar
Avatar
Avatar
5
jul. 17
6818
Base Report Designer and Invoice File not working
invoice account.invoice
Avatar
Avatar
Avatar
3
mar. 15
5637
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