diff --git a/addons/stock_sms/models/stock_picking.py b/addons/stock_sms/models/stock_picking.py index 4588275ee7d..f3344a483e6 100644 --- a/addons/stock_sms/models/stock_picking.py +++ b/addons/stock_sms/models/stock_picking.py @@ -54,6 +54,9 @@ class Picking(models.Model): super(Picking, self)._send_confirmation_email() if not self.env.context.get('skip_sms') and not getattr(threading.currentThread(), 'testing', False) and not self.env.registry.in_test_mode(): pickings = self.filtered(lambda p: p.company_id.stock_move_sms_validation and p.picking_type_id.code == 'outgoing' and (p.partner_id.mobile or p.partner_id.phone)) + # Avoid sending SMS for POS deliveries + if 'pos_type_id' in self.env['stock.warehouse']: + pickings = pickings.filtered(lambda p: p.picking_type_id != p.picking_type_id.warehouse_id.pos_type_id) for picking in pickings: # Sudo as the user has not always the right to read this sms template.