Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] mis_builder_cash_flow: Allow to override query #1252

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mis_builder_cash_flow/report/mis_cash_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def _selection_parent_state(self):
"selection"
]

def init(self):
query = """
def _init_query(self):
return """
SELECT
-- we use negative id to avoid duplicates and we don't use
-- ROW_NUMBER() because the performance was very poor
Expand Down Expand Up @@ -108,6 +108,9 @@ def init(self):
fl.date as date
FROM mis_cash_flow_forecast_line as fl
"""

def init(self):
query = self._init_query()
tools.drop_view_if_exists(self.env.cr, self._table)
self._cr.execute(
"CREATE OR REPLACE VIEW %s AS (%s)", (AsIs(self._table), AsIs(query))
Expand Down
Loading