line: beachtet nur buchungen bis zum aktuellen tag

This commit is contained in:
Frederik Jaeckel 2022-11-07 08:57:39 +01:00
parent 8302dac3a1
commit 04709e3d4a

View file

@ -176,6 +176,7 @@ class EvaluationLine(ModelSQL, ModelView):
Lines = pool.get('cashbook.line')
Cashbook = pool.get('cashbook.book')
Currency = pool.get('currency.currency')
IrDate = pool.get('ir.date')
tab_line = Lines.__table__()
tab_book = Cashbook.__table__()
cursor = Transaction().connection.cursor()
@ -191,6 +192,7 @@ class EvaluationLine(ModelSQL, ModelView):
lines = Lines.search([
('cashbook.btype.id', '=', self.dtype.id),
('cashbook.state', '=', 'open'),
('date', '<=', IrDate.today()),
], query=True)
query = lines.join(tab_line, condition=lines.id==tab_line.id,
@ -221,6 +223,7 @@ class EvaluationLine(ModelSQL, ModelView):
pool = Pool()
Lines = pool.get('cashbook.line')
Currency = pool.get('currency.currency')
IrDate = pool.get('ir.date')
tab_line = Lines.__table__()
cursor = Transaction().connection.cursor()
@ -235,6 +238,7 @@ class EvaluationLine(ModelSQL, ModelView):
lines = Lines.search([
('cashbook.currency.id', '=', self.currency.id),
('cashbook.state', '=', 'open'),
('date', '<=', IrDate.today()),
], query=True)
query = lines.join(tab_line, condition=lines.id==tab_line.id,