From b3dc3607e628c9408dc7a8d98ff6bf85fa13efcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Jan 2022 12:54:56 +0100 Subject: [PATCH] Ensure to set correct company context when calling today issue11046 review370421002 --- asset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asset.py b/asset.py index 7a1666ba35..115711c108 100644 --- a/asset.py +++ b/asset.py @@ -597,7 +597,8 @@ class Asset(Workflow, ModelSQL, ModelView): MoveLine = pool.get('account.move.line') if date is None: - date = Date.today() + with Transaction().set_context(company=self.company.id): + date = Date.today() period_id = Period.find(self.company.id, date) if self.supplier_invoice_line: account_asset = self.supplier_invoice_line.account.current()