Outils pour utilisateurs

Outils du site


clients:piermi:odoo:moisniversaire

Ceci est une ancienne révision du document !


Piermi: Odoo - Mois Anniversaire

Description High Level

But: Le client souhaite pouvoir enregistrer le mois de la date d'anniversaire du client dans odoo pour lui offrir automatiquement une réduction à l'approche de cette date (envoi massif à tous les clients né un mois de xxx).

Solution en V15:

  • Ajout d'un champ dans la fiche res.partner
  • Message dans le MyPortal pour inviter le client à transmettre son mois d'anniversaire
  • Campagne de bon de réduction + Template email dédié

Description Technique v15

Ajout d'un champ dans la fiche res.partner

Le champ a été initialement créé via Odoo Studio à une époque où j'étais débutant en Odoo. Il suivra en principe les différentes mises-à-jours d'Odoo.

Campagne de bon de réduction + template email

template email

Un nouveau template a été généré pour pouvoir contacter les clients. Paramètres → Technique → Modèles de courrier De info@lingerie-pierre.com Pour (partenaires) object.source_pos_order_id.partner_id.id_or_object.partner_id.id

<table role="presentation" style="box-sizing:border-box;border-collapse:collapse;width:570px;height:807px;" width="570px" height="807px" cellspacing="0" cellpadding="0" border="0" align="center">
    <tbody><tr>
        <td style="background: url('https://www.lingerie-pierre.com/web/image/105740-93476e0d/confetti_570.jpeg?access_token=4c486a4a-a1e3-458b-8886-933dd03bfbfe')" width="570px" valign="top" height="807px" bgcolor="#ffffff”" background="https://www.lingerie-pierre.com/web/image/105740-93476e0d/confetti_570.jpeg?access_token=4c486a4a-a1e3-458b-8886-933dd03bfbfe" align="center">
            <!--[if gte mso 9]>
            <v:image xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style=" border: 0;display: inline-block; width: 570pt; height: 807pt;" src="https://www.lingerie-pierre.com/web/image/105740-93476e0d/confetti_570.jpeg?access_token=4c486a4a-a1e3-458b-8886-933dd03bfbfe" ></v:image>
            <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style=" border: 0;display: inline-block;position: absolute; width: 570pt; height:807pt;">
            <v:fill  opacity="0%" color="#ffffff”  ></v:fill>
            <v:textbox inset="0,0,0,0">
            <![endif]-->
            <div>
                <div style="font-size: 0;">
                    <table role="presentation" style="box-sizing:border-box;border-collapse:collapse;width:570px;height:307px;vertical-align: middle;margin-top:230px;" vertical-align="middle" width="570px" height="307px" cellspacing="0" cellpadding="0" border="0" align="center">
                        <tbody><tr>
                            <td style="text-align: center; font-size: 14px;">
 
                                    <t t-if="object.partner_id.name" data-oe-t-group="0" data-oe-t-group-active="true" data-oe-t-inline="true">
                                        <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;">
                                            Félicitations <br>
                                            <t t-out="object.partner_id.name or ''" contenteditable="false" data-oe-t-inline="true">Brandon Freeman</t>,                                                             
                                            <br>C'est le mois de votre anniversaire,
                                            <br>La Lingerie Pierre vous offre <br>
                                        </strong>
                                    </t>
 
                                    <t t-if="object.program_id.reward_type == 'discount'" data-oe-t-group="1" data-oe-t-selectable="true" data-oe-t-group-active="true" data-oe-t-inline="true">
                                        <t t-if="object.program_id.discount_type == 'fixed_amount'" data-oe-t-group="2" data-oe-t-selectable="true" data-oe-t-group-active="true" data-oe-t-inline="true">
                                            <span style="font-size: 50px; color: #ED217B; font-weight: bold;" t-out="'%s' % format_amount(object.program_id.discount_fixed_amount, object.program_id.currency_id) or ''" contenteditable="false">$ 10.0</span><br>
                                            <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;">sur votre prochaine commande</strong><br>
                                        </t>
                                        <t t-else="" data-oe-t-selectable="true" data-oe-t-group="2" data-oe-t-inline="true">
                                            <span style="font-size: 50px; color: #ED217B; font-weight: bold;">
                                                <t t-out="object.program_id.discount_percentage or ''" contenteditable="false" data-oe-t-inline="true">10.0</t>%
                                            </span>
                                            <t t-if="object.program_id.discount_apply_on == 'specific_products'" data-oe-t-group="3" data-oe-t-selectable="true" data-oe-t-group-active="true" data-oe-t-inline="true">
                                                <br>
                                                <t t-if="len(object.program_id.discount_specific_product_ids) != 1" data-oe-t-group="4" data-oe-t-selectable="true" data-oe-t-group-active="true" data-oe-t-inline="true">
                                                    <t t-set="display_specific_products" t-value="True" data-oe-t-inline="true">
                                                    </t>
                                                    <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;">
                                                        sur certains produits*
                                                    </strong>
                                                </t>
                                                <t t-else="" data-oe-t-selectable="true" data-oe-t-group="4" data-oe-t-inline="true">
                                                    <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;" t-out="'on %s' % object.program_id.discount_specific_product_ids.name or ''" contenteditable="false">Protection Sol</strong>
                                                </t>
                                            </t>
                                            <t t-elif="object.program_id.discount_apply_on == 'cheapest_product'" data-oe-t-selectable="true" data-oe-t-group="3" data-oe-t-inline="true">
                                                <br><strong style="box-sizing:border-box;font-weight:500;font-size: 20px;">
                                                    de remise sur l'article le moins cher
                                                </strong>
                                            </t>
                                            <t t-else="" data-oe-t-selectable="true" data-oe-t-group="3" data-oe-t-inline="true">
                                                <br><strong style="box-sizing:border-box;font-weight:500;font-size: 20px;">
                                                    sur votre prochaine commande
                                                </strong>
                                            </t>
                                            <br>
                                        </t>
                                    </t>
                                    <t t-elif="object.program_id.reward_type == 'product'" data-oe-t-selectable="true" data-oe-t-group="1" data-oe-t-inline="true">
                                        <span style="font-size: 36px; color: #875A7B; font-weight: bold;" t-out="'get %s free %s' % (object.program_id.reward_product_quantity, object.program_id.reward_product_id.name) or ''" contenteditable="false"> Protection Sol</span><br>
                                        <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;"> sur votre
                                            prochaine
                                            commande</strong><br>
                                    </t>
                                    <t t-elif="object.program_id.reward_type == 'free_shipping'" data-oe-t-selectable="true" data-oe-t-group="1" data-oe-t-inline="true">
                                        <span style="font-size: 36px; color: #875A7B; font-weight: bold;">
                                            obtenez une livraison gratuite
                                        </span><br>
                                        <strong style="box-sizing:border-box;font-weight:500;font-size: 20px;"> sur votre
                                            prochaine
                                            commande</strong><br>
                                    </t>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: center; font-size: 14px;" valign="top">
                                A utiliser 
                                <t t-if="object.expiration_date" data-oe-t-group="5" data-oe-t-group-active="true" data-oe-t-inline="true">
                                    avant le <t t-out="object.expiration_date or ''" contenteditable="false" data-oe-t-inline="true">
                                        2021_06_05</t>
                                </t><br>
                                Valable en magasin et sur notre <a href="https://www.lingerie-pierre.com" style="text-decoration:none;box-sizing:border-box;background-color:transparent;color:#008f8c;">site web</a>.
                                <p style="box-sizing:border-box;margin-top: 16px;">
                                    <strong style="box-sizing:border-box;font-weight:500;padding: 16px 8px 16px 8px; border-radius: 3px; background-color: #F1F1F1;" t-out="object.code or ''" contenteditable="false">481399630193260690109548</strong>                                
                                </p>
                                <!--<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('QR', object.code, 75, 75)" style="border-style:none;box-sizing:border-box;vertical-align:middle;width: 0px; height: 0px;" width="0px" height="0">-->                        
                                <t t-if="object.program_id.rule_min_quantity not in [0, 1]" data-oe-t-group="6" data-oe-t-group-active="true" data-oe-t-inline="true">
                                    <span style="font-size: 14px;">
                                        Achat minimum de <t t-out="object.program_id.rule_min_quantity or ''" contenteditable="false" data-oe-t-inline="true">10</t> articles
                                    </span><br>
                                </t>
                                <t t-if="object.program_id.rule_minimum_amount != 0.00" data-oe-t-group="7" data-oe-t-group-active="true" data-oe-t-inline="true">
                                    <span style="font-size: 14px;">
                                        Valide pour achat supérieur à €
                                        <t t-out="'%0.2f' % float(object.program_id.rule_minimum_amount) or ''" contenteditable="false" data-oe-t-inline="true">10.00</t>
                                    </span><br>
                                </t>
                                <t t-if="display_specific_products" data-oe-t-group="8" data-oe-t-group-active="true" data-oe-t-inline="true">
 
                                        *Valide pour les articles suivants:<t t-out="', '.join(object.program_id.discount_specific_product_ids.mapped('name')) or ''" contenteditable="false" data-oe-t-inline="true"> Chaise de bureau Noire</t>
                                    <br>
                                </t>&nbsp;
                               &nbsp;<table style="box-sizing:border-box;border-collapse:collapse;"><tbody style="vertical-align: top;"></tbody></table>
                            </td>
                        </tr>
                    </tbody></table>
                </div>
            </div>
            <!--[if gte mso 9]>
            </v:textbox>
            </v:fill>
            </v:rect>
            </v:image>
            <![endif]-->
        </td>
    </tr>
</tbody></table>

Campagne de bon de réduction

Dans “Ventes → Articles → Campagnes de bons de réduction”, une nouvelle campagne de bons de réduction a été créée.

Important, elle s'applique sur tous les produits, a une durée de 30 jours et octroie 10% de remise au client.

En cliquant sur générer les coupons, on peut choisir le “Nombre de clients sélectionnés” et définir des règles sur lesquels ces bons seront générés. Je crée un filtre de base (2) et je pointe le modèle email précédemment créé (3) et pour faire gagner du temps au client je sauvegarde ce formulaire modifié pour le rendre par défaut grâce au menu debugging (4)

Résultat: quand le vendeur aura défini le mois en question, il enverra en masse des bons à tous les clients ayant ce mois dans leurs données.

clients/piermi/odoo/moisniversaire.1707768600.txt.gz · Dernière modification : de root