[FIX] account_financial_report: Fix error when generating reports

Some reports crash if account move line implicated are Sections lines or Notes lines in an invoice
pull/939/head
Ernesto Tejeda 2020-04-09 12:37:55 -04:00 committed by David Ramia
parent d7b6935b34
commit bd5bb09334
19 changed files with 7421 additions and 18394 deletions

View File

@ -5,7 +5,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Financial Reports",
"version": "13.0.1.0.0",
"version": "13.0.1.1.0",
"category": "Reporting",
"summary": "OCA Financial Reports",
"author": "Camptocamp SA,"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -329,7 +329,11 @@ class GeneralLedgerReport(models.AbstractModel):
analytic_tag_ids,
cost_center_ids,
):
domain = [("date", ">=", date_from), ("date", "<=", date_to)]
domain = [
("display_type", "=", False),
("date", ">=", date_from),
("date", "<=", date_to),
]
if account_ids:
domain += [("account_id", "in", account_ids)]
if company_id:

View File

@ -79,8 +79,7 @@ class JournalLedgerReport(models.AbstractModel):
return moves.ids, Moves, move_data
def _get_move_lines_domain(self, move_ids, wizard, journal_ids):
return [("move_id", "in", move_ids)]
return [("display_type", "=", False), ("move_id", "in", move_ids)]
def _get_move_lines_order(self, move_ids, wizard, journal_ids):
return ""

View File

@ -123,7 +123,11 @@ class TrialBalanceReport(models.AbstractModel):
only_posted_moves,
show_partner_details,
):
domain = ["&", ("date", ">=", date_from), ("date", "<=", date_to)]
domain = [
("display_type", "=", False),
("date", ">=", date_from),
("date", "<=", date_to),
]
if company_id:
domain += [("company_id", "=", company_id)]
if account_ids: