Skip to content

Commit

Permalink
Merge pull request #559 from ursais/hs_Task_osi_addon_31082
Browse files Browse the repository at this point in the history
[FIX] Delivery Hold / Credit Hold
  • Loading branch information
agyamuta authored Aug 25, 2023
2 parents d35fa10 + 0f365c5 commit 71e28d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion osi_partner_credit_limit/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def used_credit_limit_balance(self, partner_id=None):
order_ids = self.env["sale.order"].search(
[
("partner_id", "=", partner_id.id),
("state", "=", "sale"),
("state", "in", ("sale", "done")),
("invoice_status", "!=", "invoiced"),
]
)
Expand Down
4 changes: 4 additions & 0 deletions osi_partner_credit_limit/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ def action_confirm(self):
)
raise ValidationError(message)
return super(SaleOrder, self).action_confirm()

def write(self, vals):
vals.update({"ship_hold": self.partner_id.ship_hold})
return super(SaleOrder, self).write(vals)
4 changes: 2 additions & 2 deletions osi_partner_credit_limit/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _compute_allow_transfer(self):
if (
record.sale_id.sales_hold
or record.sale_id.credit_hold
or record.sale_id.ship_hold
or record.sale_id.ship_hold or record.partner_id.ship_hold
):
hold_value = True

Expand All @@ -44,7 +44,7 @@ def _compute_allow_transfer(self):

def button_validate(self):
# Only outgoing picking
if self.picking_type_code == "outgoing":
if self.picking_type_code == "outgoing" and self.partner_id.ship_hold:
if self.dont_allow_transfer:
raise UserError(
_(
Expand Down

0 comments on commit 71e28d0

Please sign in to comment.