Skip to content

Commit

Permalink
[IMP] base_exception: method exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mav-adhoc committed Oct 8, 2024
1 parent a68fadd commit b9e1c67
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions base_exception/models/base_exception_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,14 @@ def _detect_exceptions_by_method(self, rule_info):
Find exceptions found on self.
"""
base_domain = self._get_base_domain()
records = self.filtered_domain(base_domain)
return getattr(records, rule_info.method)()
model = self._context.get("params", {}).get("model")
if (
rule_info.method == "button_validate"
and model == "stock.picking"
or rule_info.method == "action_confirm"
and model == "sale.order"
):
records = self.filtered_domain(base_domain)
else:
records = self.env["stock.picking"].browse()
return records

0 comments on commit b9e1c67

Please sign in to comment.