This question has been flagged

Hello there :)

I need to alert our staff when a customer choses to pay via SEPA / SDD direct debit mandate. Usually a customer gets an offer and then choses to pay in the portal. 

The problem is, our staff does not recognize this as the status of the sales order does not change. The latter circumstance is good as we need to chose different routes before confirming an order. But our staff does not get any hint that some customer has issued the mandate and therefore thinks that he or she has already paid but is not hearing form us.

Normally the accounting would say something, but as of now, that is done externally and that is not an option anymore.

I can do send messages by e-mail or our internal chat by using automated actions but I cannot find the right trigger / domain for the life of me. 

I've looked at the model "sdd.mandate" that has the promising field "payments_to_collect_nber" but this is not available when setting up the domain for the automated action. 

I need a trigger for the creation of a payment that has a sdd mandet to collect. That is at least how I think about it. 
Our staff has to be notified that a customer has paid via direct debit in the portal for a certain quotation / sales order.

Any ideas?

Avatar
Discard
Author Best Answer

I did (in Odoo 14 E.) with an automated action: 


And this is the code:

msg = 'CUSTOMER PAID VIA SEPA!\nCustomer: '
msg += record['partner_id']
msg += ', Reference: '
msg += record['display_name']


env['mail.message'].create({
'message_type': 'comment',
'subtype_id': env.ref('mail.mt_comment').id,
'model': 'mail.channel',
# 'res_id': env.ref('mail.channel_all_employees').id, # THIS MIGHT WORK FOR Odoo 16!
'channel_ids': [(6,0,[env.ref('mail.channel_all_employees').id])],
'body': msg,
})
log(msg, level='info')

When a payment comes, the generated message will be posted in the main channel of the discussion app.

Hope that helps someone someday :)


Avatar
Discard