line: gain/loss ok + test

This commit is contained in:
Frederik Jaeckel 2023-02-17 10:20:06 +01:00
parent 32eac5aa6c
commit 6ab88d9fb5
2 changed files with 138 additions and 4 deletions

View file

@ -182,8 +182,7 @@ class Line(SecondUomMixin, metaclass=PoolMeta):
((tab_mvmv_counterpart.reference == tab_line.id) | \
(tab_mvmv_counterpart.id == tab_line.reference)) & \
tab_mvmv_counterpart.bookingtype.in_(['mvin', 'mvout']) & \
(tab_mvmv_counterpart.booktransf != None) & \
(tab_mvmv_counterpart.booktransf == getattr(cfg1.gainloss_book, 'id', None)),
(tab_mvmv_counterpart.cashbook == getattr(cfg1.gainloss_book, 'id', None)),
type_ = 'LEFT OUTER',
).select(
tab_line.id,