mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add patch for issue5512
This commit is contained in:
parent
a70e8bea02
commit
18d82940e9
35
issue18061002_1.diff
Normal file
35
issue18061002_1.diff
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# HG changeset patch
|
||||||
|
# User Sergi Almacellas Abellana <sergi@koolpi.com>
|
||||||
|
Take in account access rule on reconcile wizard
|
||||||
|
|
||||||
|
issue5512
|
||||||
|
review18061002
|
||||||
|
|
||||||
|
Index: trytond/trytond/modules/account/move.py
|
||||||
|
===================================================================
|
||||||
|
|
||||||
|
--- a/trytond/trytond/modules/account/move.py
|
||||||
|
+++ b/trytond/trytond/modules/account/move.py
|
||||||
|
@@ -1835,17 +1835,20 @@
|
||||||
|
def get_accounts(self):
|
||||||
|
'Return a list of account id to reconcile'
|
||||||
|
pool = Pool()
|
||||||
|
+ Rule = pool.get('ir.rule')
|
||||||
|
Line = pool.get('account.move.line')
|
||||||
|
line = Line.__table__()
|
||||||
|
Account = pool.get('account.account')
|
||||||
|
account = Account.__table__()
|
||||||
|
cursor = Transaction().connection.cursor()
|
||||||
|
+ rule_expression = Rule.query_get(Account.__name__)
|
||||||
|
|
||||||
|
balance = line.debit - line.credit
|
||||||
|
cursor.execute(*line.join(account,
|
||||||
|
condition=line.account == account.id).select(
|
||||||
|
account.id,
|
||||||
|
- where=(line.reconciliation == Null) & account.reconcile,
|
||||||
|
+ where=((line.reconciliation == Null) & account.reconcile
|
||||||
|
+ & account.id.in_(rule_expression)),
|
||||||
|
group_by=account.id,
|
||||||
|
having=(
|
||||||
|
Sum(Case((balance > 0, 1), else_=0)) > 0)
|
||||||
|
|
1
series
1
series
|
@ -27,6 +27,7 @@ analytic_account.diff
|
||||||
analytic_invoice.diff
|
analytic_invoice.diff
|
||||||
analytic_sale.diff
|
analytic_sale.diff
|
||||||
analytic_purchase.diff
|
analytic_purchase.diff
|
||||||
|
issue18061002_1.diff
|
||||||
|
|
||||||
# Ignore next patches
|
# Ignore next patches
|
||||||
#incremental_wait_in_retries.diff
|
#incremental_wait_in_retries.diff
|
||||||
|
|
Loading…
Reference in a new issue