[account_financial_report][IMP] Adds the following:

All reports:
- Rename field to hide accounts at 0 to 'hide_account_at_0'
Trial Balance:
- Add possibility to filter by hierarchy levels
- XLSX format will show the hierarchy levels in bold

General Ledger:
- Add the possibility to filter by analytic tags
- Fixes an error on the default date
Journal Ledger:
- The filter on Journals is now optional. If the user does not choose
a journal, by default it will display all journals.

Aged Partner Balance:
- Fixes an error on the default date
This commit is contained in:
Jordi Ballester Alomar
2018-11-22 12:52:27 +01:00
committed by chaule97
parent 1aa03c7bb7
commit 99fb232194
22 changed files with 597 additions and 124 deletions

View File

@@ -39,19 +39,48 @@ class TestGeneralLedger(a_t_f_c.AbstractTestForeignCurrency):
}
def _getAdditionalFiltersToBeTested(self):
return [
additional_filters = [
{'only_posted_moves': True},
{'hide_account_balance_at_0': True},
{'hide_account_at_0': True},
{'centralize': True},
{'only_posted_moves': True, 'hide_account_balance_at_0': True},
{'only_posted_moves': True, 'hide_account_at_0': True},
{'only_posted_moves': True, 'centralize': True},
{'hide_account_balance_at_0': True, 'centralize': True},
{'hide_account_at_0': True, 'centralize': True},
{
'only_posted_moves': True,
'hide_account_balance_at_0': True,
'hide_account_at_0': True,
'centralize': True
},
]
# Add `show_analytic_tags` filter on each cases
additional_filters_with_show_tags = []
for additional_filter in additional_filters:
additional_filter['show_analytic_tags'] = True
additional_filters_with_show_tags.append(
additional_filter
)
additional_filters += additional_filters_with_show_tags
# Add `filter_analytic_tag_ids` filter on each cases
analytic_tag = self.env['account.analytic.tag'].create({
'name': 'TEST tag'
})
# Define all move lines on this tag
# (this test just check with the all filters, all works technically)
move_lines = self.env['account.move.line'].search([])
move_lines.write({
'analytic_tag_ids': [(6, False, analytic_tag.ids)],
})
additional_filters_with_filter_tags = []
for additional_filter in additional_filters:
additional_filter['filter_analytic_tag_ids'] = [
(6, False, analytic_tag.ids)
]
additional_filters_with_filter_tags.append(
additional_filter
)
additional_filters += additional_filters_with_filter_tags
return additional_filters
class TestGeneralLedgerReport(common.TransactionCase):
@@ -120,7 +149,7 @@ class TestGeneralLedgerReport(common.TransactionCase):
'date_from': self.fy_date_start,
'date_to': self.fy_date_end,
'only_posted_moves': True,
'hide_account_balance_at_0': False,
'hide_account_at_0': False,
'company_id': company.id,
'fy_start_date': self.fy_date_start,
})