Skip to content

Commit 426c52f

Browse files
committed
[FIX] purchase_landed_cost: Avoid access error reading act_window
Using `read` for bringing act_window values requires super-admin access. Let's use `_for_xml_id` instead that is a method specially for that. TT117299
1 parent ef6fb05 commit 426c52f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

purchase_landed_cost/models/purchase_cost_distribution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def _compute_standard_price_old(self):
467467
@api.model
468468
def get_action_purchase_cost_distribution(self):
469469
xml_id = "purchase_landed_cost.action_purchase_cost_distribution"
470-
action = self.env.ref(xml_id).read()[0]
470+
action = self.env["ir.actions.act_window"]._for_xml_id(xml_id)
471471
distributions = self.mapped("distribution")
472472
if len(distributions) == 1:
473473
form = self.env.ref("purchase_landed_cost.purchase_cost_distribution_form")

0 commit comments

Comments
 (0)