[FIX] point_of_sale, stock_sms: do not send mail and SMS
Complement of PR #50720 to aovid sending email as well. opw-2250185 closes odoo/odoo#50814 closes odoo/odoo#51042 X-original-commit: 64ef9d74753ddf532cb4fc3d9769cd4913a2d9d7 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -131,3 +131,8 @@ class StockPicking(models.Model):
|
||||
self.env['stock.move.line'].create(ml_vals)
|
||||
else:
|
||||
current_move.quantity_done = abs(sum(order_lines.mapped('qty')))
|
||||
|
||||
def _send_confirmation_email(self):
|
||||
# Avoid sending Mail/SMS for POS deliveries
|
||||
pickings = self.filtered(lambda p: p.picking_type_id != p.picking_type_id.warehouse_id.pos_type_id)
|
||||
return super(StockPicking, pickings)._send_confirmation_email()
|
||||
|
||||
@@ -54,10 +54,6 @@ 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.
|
||||
template = picking.company_id.sudo().stock_sms_confirmation_template_id
|
||||
|
||||
Reference in New Issue
Block a user