Merge pull request #5603 from expsa/sms_edit
[IMP] ensan_sale_management: send confirmation message when the order…
This commit is contained in:
commit
d24b1405c2
|
|
@ -100,13 +100,14 @@ class SaleOrder(models.Model):
|
|||
})
|
||||
|
||||
def action_confirm(self):
|
||||
old_state = self.state
|
||||
res = super().action_confirm()
|
||||
bot = self.env.ref('base.partner_root').id
|
||||
if res:
|
||||
sms_template_id = self.env.ref('ensan_sale_management.sms_template_data_donation')
|
||||
donar_sms_template_id = self.env.ref('ensan_sale_management.sms_template_donors_data_donation')
|
||||
for rec in self:
|
||||
if rec.state == 'sale' and not self._context.get('skip_donation_sms'):
|
||||
if old_state in ('draft', 'sent') and rec.state in ('sale', 'done') and not self._context.get('skip_donation_sms'):
|
||||
if rec.order_mobile_number:
|
||||
rec._message_sms_with_template(
|
||||
template=sms_template_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue