From 083b5648b5747d7448ca8b49ca013bdbe6f5ddc5 Mon Sep 17 00:00:00 2001 From: Urvisha-OSI Date: Tue, 1 Aug 2023 11:58:44 +0530 Subject: [PATCH] [FIX] not allowed to mass validate on delivery orders --- .../models/stock_picking.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/osi_partner_credit_limit/models/stock_picking.py b/osi_partner_credit_limit/models/stock_picking.py index 2171b79a2..e3943572c 100644 --- a/osi_partner_credit_limit/models/stock_picking.py +++ b/osi_partner_credit_limit/models/stock_picking.py @@ -44,18 +44,19 @@ def _compute_allow_transfer(self): def button_validate(self): # Only outgoing picking - if self.picking_type_code == "outgoing": - if self.dont_allow_transfer: - raise UserError( - _( - """Customer has a Credit hold.\n\nContact - Sales/Accounting to verify - sales hold/credit hold/overdue payments.""" + for picking in self: + if picking.picking_type_code == "outgoing": + if picking.dont_allow_transfer: + raise UserError( + _( + """Customer has a Credit hold.\n\nContact + Sales/Accounting to verify + sales hold/credit hold/overdue payments.""" + ) ) - ) + else: + return super(StockPicking, self).button_validate() + + # Incoming shipments / internal transfers else: return super(StockPicking, self).button_validate() - - # Incoming shipments / internal transfers - else: - return super(StockPicking, self).button_validate()