Ensure to set correct company context when calling today

issue11046
review370421002
This commit is contained in:
Cédric Krier committed 2022-01-23 12:54:56 +01:00
1 parent 8ba18fdbcc
commit 6cd855a214
1 file changed
+2 -1
+2 -1
View File
@@ -224,7 +224,8 @@ class Payment(metaclass=PoolMeta):
return self.clearing_move
if date is None:
date = Date.today()
with Transaction().set_context(company=self.company.id):
date = Date.today()
period = Period.find(self.company.id, date=date)
local_currency = self.journal.currency == self.company.currency