From 64e837462d6e2ef435f97e318261e3e7f24f3ae5 Mon Sep 17 00:00:00 2001 From: Saran440 Date: Tue, 23 Jul 2024 12:03:58 +0700 Subject: [PATCH] [FIX] budget_control_purchase_request: permission fiscal_year --- .../wizards/purchase_request_line_make_purchase_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/budget_control_purchase_request/wizards/purchase_request_line_make_purchase_order.py b/budget_control_purchase_request/wizards/purchase_request_line_make_purchase_order.py index 576f9c7c..15cc0e11 100644 --- a/budget_control_purchase_request/wizards/purchase_request_line_make_purchase_order.py +++ b/budget_control_purchase_request/wizards/purchase_request_line_make_purchase_order.py @@ -24,7 +24,7 @@ def _prepare_purchase_order_line(self, po, item): if vals.get("account_analytic_id") and item.line_id.fwd_analytic_account_id: vals["account_analytic_id"] = item.line_id.fwd_analytic_account_id.id # Check if date_commit is not in the fiscal year, then update it - fy_dates = item.line_id.company_id.compute_fiscalyear_dates( + fy_dates = item.line_id.company_id.sudo().compute_fiscalyear_dates( fields.Date.context_today(self) ) if item.line_id.date_commit > fy_dates["date_to"]: