Ir al contenido
Menú
Se marcó esta pregunta
4 Respuestas
2918 Vistas

I want when the manufacturing order for a product linked to a sales order is finalized, an email (and Whatsapp message) be sent to the customer who placed the order, to notify them that their order is ready and to let them know that they can pick it up.


I'm using odoo. sh 16

Avatar
Descartar

Hello,

You can configure the automated action to directly send the email to the particular users when the manufacturing order is done.

Thanks,
info@creyox.com

Autor Mejor respuesta

Thank you very much for the answers, they have been useful to me, but I still can't achieve my goal.


I went so far as to configure an automated action to send an email to the client (which is not sent).


I would like to make it possible to send a WhatsApp message automatically (without having to click), when the conditions are met.


You can see here what I have so far:

https://youtu.be/2-QFEiQ6f-E


Thank you very much, greetings!




Avatar
Descartar
Mejor respuesta

Hi,You can achieve this by overriding the 'Done' button in the manufacturing order. If a manufacturing order is created from a sales order, you can retrieve the customer from the sales order as shown below:

```python
def button_mark_done(self):
    res = super(MrpProduction).button_mark_done()
    for production in self:        partner = production.procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id
        email_values = {
            'email_cc': False,
            'email_to': partner.partner_id.mail,
        }
        mail_template = self.env.ref('model_name.mail_template_id')
        mail_template.send_mail(self.id, email_values=email_values, force_send=True)
The provided code allows you to send an email to the customer. Ensure that you create a mail template for this purpose. Refer to the blog 
How to Create Email Template in Odoo 16 to learn how to create a mail template.

Note: This approach is specifically intended for manufacturing orders generated from a sales order. For regular manufacturing orders (not generated from a sales order), it is recommended to include a custom field within the manufacturing order to retrieve the customer's email address.You can add a new field by using the Xpath method example:

<record id="mrp_productio_view_form" model="ir.ui.view">
<field
name="name">mrp.productio.view.form.inherit</field>
<field
name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
            <field name="mode">primary</field>
            <field name="priority">24</field>
            <field name="arch" type="xml">
                <xpath expr="field[@name='bom_id']" position="before">
                    <field name="partner_id" />
                </xpath>
            </field>
        </record>


And after that you can select the email of this selected customer


Hope it helps

Avatar
Descartar
Mejor respuesta

As your are Manufacturing based on Order (MTO) - solution will depend on how your MTO is configure.

Also Ideally, your trigger point should be on Delivery order (which will set to Ready state once you mark you MTO Manufacturing as Done)

Developing some automation can do the parial job of email as below

Moreover using the Whatsapp apps like twilio_whatsapp integration - still some minor customization will be needed to fulfill your whole workflow to give seamless notification to your ordering customers.

https://apps.odoo.com/apps/modules/16.0/twilio_whatsapp_odoo_integration_sit/


Avatar
Descartar
Mejor respuesta

To achieve the goal of sending an email and a WhatsApp message to the customer when a manufacturing order linked to a sales order is finalized in Odoo 16, you can follow these steps:

Configure Your Email Server:

Make sure you have configured your email server settings in Odoo correctly. Go to Settings > General Settings > Email and set up your outgoing email server.

Install WhatsApp Integration:

You'll need a WhatsApp integration or add-on to send WhatsApp messages programmatically. You can explore Odoo apps or third-party integrations for WhatsApp messaging.

Customize the Manufacturing Module:

You will need to customize the manufacturing module in Odoo to trigger actions when a manufacturing order is finalized.

Create a Custom Module:

In Odoo, it's best practice to create a custom module for your specific customizations. You can use the Odoo development environment to create a custom module.

Add Custom Code:

In your custom module, add Python code to listen for the event of a manufacturing order being finalized. You can use Odoo's built-in event listeners or write custom Python code for this.

Send Email and WhatsApp Message:

Once the event is triggered (manufacturing order finalized), write code to send an email and a WhatsApp message to the customer who placed the order. You can use Odoo's built-in email sending functionality and integrate with a WhatsApp API or integration for sending WhatsApp messages.

Thanks & Regards, 

 

Brain Station 23 Ltd. 

Mobile: (+880) 1404055226 

Email: sales@brainstation-23.com 

Web: https://brainstation-23.com/ 

Address: (Building-1) 8th Floor, 2 Bir Uttam AK Khandakar Road, Mohakhali C/A, Dhaka 1212, Bangladesh 

 

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
ago 25
1558
1
may 25
1273
2
may 25
1425
0
abr 25
1131
1
mar 25
1624