Skip to content

Commit

Permalink
[FIX] not allowed to mass validate on delivery orders
Browse files Browse the repository at this point in the history
  • Loading branch information
Urvisha-OSI committed Aug 1, 2023
1 parent 13d5499 commit 083b564
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions osi_partner_credit_limit/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 083b564

Please sign in to comment.