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

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

S'inscrire

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

Cette question a été signalée
invoiceemailaccount.invoicesendmailsending mail with attachment
1 Répondre
4761 Vues
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
Ignorer
Avatar
Sendy Hartanto
Auteur Meilleure réponse

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
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 Invoice to All Account Contacts
accounting invoice contacts account.invoice sending mail with attachment
Avatar
0
avr. 22
3348
cant send email because of ValueError: invalid literal for int() with base 10: '${object.partner_id.id}' Résolu
email sendmail
Avatar
Avatar
2
janv. 25
9395
Odoo10: very simple example for sending email via Python
email sendmail
Avatar
Avatar
Avatar
2
janv. 20
15177
send multiple invoice via e-mail
invoice email
Avatar
Avatar
Avatar
Avatar
Avatar
5
juil. 17
6831
Base Report Designer and Invoice File not working
invoice account.invoice
Avatar
Avatar
Avatar
3
mars 15
5657
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