details: https://code.tryton.org/tryton/commit/081a4dd51d8d
branch: 6.0
user: Cédric Krier <[email protected]>
date: Thu Apr 02 17:57:12 2026 +0200
description:
Use party with origin's company in the context to retrieve accounts
when applying statement rule
Closes #14740
(grafted from d6e797ed25c68b052cefc5ccde35995f40028a3b)
diffstat:
modules/account_statement_rule/account.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (23 lines):
diff -r 7a8caca5a14e -r 081a4dd51d8d modules/account_statement_rule/account.py
--- a/modules/account_statement_rule/account.py Thu Apr 02 10:26:27 2026 +0200
+++ b/modules/account_statement_rule/account.py Thu Apr 02 17:57:12 2026 +0200
@@ -321,6 +321,7 @@
def get_line(self, origin, keywords, **context):
pool = Pool()
Line = pool.get('account.statement.line')
+ Party = pool.get('party.party')
context.setdefault('functions', {})['Decimal'] = Decimal
context.setdefault('names', {}).update(keywords)
@@ -339,7 +340,10 @@
if invoice:
account = invoice.account
elif party:
- with Transaction().set_context(date=origin.date):
+ with Transaction().set_context(
+ date=origin.date,
+ company=origin.company.id):
+ party = Party(party.id)
if amount > Decimal(0):
account = party.account_receivable_used
else: