Merge pull request #5603 from expsa/sms_edit

[IMP] ensan_sale_management: send confirmation message when the order…
This commit is contained in:
abdurrahman-saber 2025-12-03 12:13:54 +04:00 committed by GitHub
commit d24b1405c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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,