diff --git a/line.py b/line.py index ebfd412..02eb4ba 100644 --- a/line.py +++ b/line.py @@ -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,