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 d9d7528
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions base_exception/models/base_exception_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ def _detect_exceptions_by_method(self, rule_info):
"""
Find exceptions found on self.
"""
import pdb; pdb.set_trace()
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 d9d7528

Please sign in to comment.