diff --git a/account_financial_report_qweb/__manifest__.py b/account_financial_report_qweb/__manifest__.py index e94adfed..8eaaa8a2 100644 --- a/account_financial_report_qweb/__manifest__.py +++ b/account_financial_report_qweb/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'QWeb Financial Reports', - 'version': '10.0.2.0.1', + 'version': '10.0.3.0.0', 'category': 'Reporting', 'summary': 'OCA Financial Reports', 'author': 'Camptocamp SA,' diff --git a/account_financial_report_qweb/readme/HISTORY.rst b/account_financial_report_qweb/readme/HISTORY.rst index c353a208..5df73869 100644 --- a/account_financial_report_qweb/readme/HISTORY.rst +++ b/account_financial_report_qweb/readme/HISTORY.rst @@ -1,3 +1,12 @@ +10.0.3.0.0 (2019-01-09) +~~~~~~~~~~~~~~~~~~~~~~~ + +* Improve multicompany related usability. +* Improve performance in the General Ledger. +* The reports now display an improved title that includes report name, + company and currency. + + 10.0.2.0.0 (2018-11-29) ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/account_financial_report_qweb/report/abstract_report_xlsx.py b/account_financial_report_qweb/report/abstract_report_xlsx.py index 6d5f3152..fceb68f1 100644 --- a/account_financial_report_qweb/report/abstract_report_xlsx.py +++ b/account_financial_report_qweb/report/abstract_report_xlsx.py @@ -43,7 +43,7 @@ class AbstractReportXslx(ReportXlsx): self._define_formats(workbook) - report_name = self._get_report_name(objects) + report_name = self._get_report_name(report) report_footer = self._get_report_footer() filters = self._get_report_filters(report) self.columns = self._get_report_columns(report) diff --git a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py index 0cdf9e8c..7200962c 100644 --- a/account_financial_report_qweb/report/aged_partner_balance_xlsx.py +++ b/account_financial_report_qweb/report/aged_partner_balance_xlsx.py @@ -15,8 +15,7 @@ class AgedPartnerBalanceXslx(abstract_report_xlsx.AbstractReportXslx): super(AgedPartnerBalanceXslx, self).__init__( name, table, rml, parser, header, store) - def _get_report_name(self, objects): - report = objects + def _get_report_name(self, report): return _('Aged Partner Balance - %s - %s') % ( report.company_id.name, report.company_id.currency_id.name) diff --git a/account_financial_report_qweb/report/general_ledger_xlsx.py b/account_financial_report_qweb/report/general_ledger_xlsx.py index a0a687a4..5e68d83d 100644 --- a/account_financial_report_qweb/report/general_ledger_xlsx.py +++ b/account_financial_report_qweb/report/general_ledger_xlsx.py @@ -16,8 +16,7 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx): super(GeneralLedgerXslx, self).__init__( name, table, rml, parser, header, store) - def _get_report_name(self, objects): - report = objects + def _get_report_name(self, report): return _('General Ledger - %s - %s') % ( report.company_id.name, report.company_id.currency_id.name) diff --git a/account_financial_report_qweb/report/journal_report_xlsx.py b/account_financial_report_qweb/report/journal_report_xlsx.py index eb693c05..7b838f5f 100644 --- a/account_financial_report_qweb/report/journal_report_xlsx.py +++ b/account_financial_report_qweb/report/journal_report_xlsx.py @@ -17,8 +17,7 @@ class JournalXslx(abstract_report_xlsx.AbstractReportXslx): super(JournalXslx, self).__init__( name, table, rml, parser, header, store) - def _get_report_name(self, objects): - report = objects + def _get_report_name(self, report): return _('Journal Ledger - %s - %s') % ( report.company_id.name, report.company_id.currency_id.name) diff --git a/account_financial_report_qweb/report/open_items_xlsx.py b/account_financial_report_qweb/report/open_items_xlsx.py index b32a7ea2..566b4e78 100644 --- a/account_financial_report_qweb/report/open_items_xlsx.py +++ b/account_financial_report_qweb/report/open_items_xlsx.py @@ -15,8 +15,7 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx): super(OpenItemsXslx, self).__init__( name, table, rml, parser, header, store) - def _get_report_name(self, objects): - report = objects + def _get_report_name(self, report): return _('Open Items - %s - %s') % ( report.company_id.name, report.company_id.currency_id.name) diff --git a/account_financial_report_qweb/report/templates/aged_partner_balance.xml b/account_financial_report_qweb/report/templates/aged_partner_balance.xml index 885008f7..7813918d 100644 --- a/account_financial_report_qweb/report/templates/aged_partner_balance.xml +++ b/account_financial_report_qweb/report/templates/aged_partner_balance.xml @@ -19,7 +19,7 @@ Aged Partner Balance - - -
+

diff --git a/account_financial_report_qweb/report/templates/general_ledger.xml b/account_financial_report_qweb/report/templates/general_ledger.xml index 95da78e8..6745a691 100644 --- a/account_financial_report_qweb/report/templates/general_ledger.xml +++ b/account_financial_report_qweb/report/templates/general_ledger.xml @@ -20,7 +20,7 @@ General Ledger - - -
+

diff --git a/account_financial_report_qweb/report/templates/journal.xml b/account_financial_report_qweb/report/templates/journal.xml index 545c8a42..b65d42cf 100644 --- a/account_financial_report_qweb/report/templates/journal.xml +++ b/account_financial_report_qweb/report/templates/journal.xml @@ -17,7 +17,7 @@ -
+

diff --git a/account_financial_report_qweb/report/templates/open_items.xml b/account_financial_report_qweb/report/templates/open_items.xml index 561f28e8..fc6eb319 100644 --- a/account_financial_report_qweb/report/templates/open_items.xml +++ b/account_financial_report_qweb/report/templates/open_items.xml @@ -17,7 +17,7 @@ -
+

diff --git a/account_financial_report_qweb/report/templates/trial_balance.xml b/account_financial_report_qweb/report/templates/trial_balance.xml index 6e2f0b8e..0fdf28d5 100644 --- a/account_financial_report_qweb/report/templates/trial_balance.xml +++ b/account_financial_report_qweb/report/templates/trial_balance.xml @@ -19,7 +19,7 @@ Trial Balance - - -
+

diff --git a/account_financial_report_qweb/report/trial_balance_xlsx.py b/account_financial_report_qweb/report/trial_balance_xlsx.py index 58e780a7..7419df49 100644 --- a/account_financial_report_qweb/report/trial_balance_xlsx.py +++ b/account_financial_report_qweb/report/trial_balance_xlsx.py @@ -15,8 +15,7 @@ class TrialBalanceXslx(abstract_report_xlsx.AbstractReportXslx): super(TrialBalanceXslx, self).__init__( name, table, rml, parser, header, store) - def _get_report_name(self, objects): - report = objects + def _get_report_name(self, report): return _('Trial Balance - %s - %s') % ( report.company_id.name, report.company_id.currency_id.name) diff --git a/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py b/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py index 2e066617..8cf0f1b4 100644 --- a/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py +++ b/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py @@ -17,7 +17,7 @@ class AgedPartnerBalance(models.TransientModel): company_id = fields.Many2one( comodel_name='res.company', default=lambda self: self.env.user.company_id, - required=True, + required=False, string='Company' ) date_at = fields.Date(required=True, @@ -47,8 +47,22 @@ class AgedPartnerBalance(models.TransientModel): lambda p: p.company_id == self.company_id or not p.company_id) if self.company_id and self.account_ids: - self.account_ids = self.account_ids.filtered( - lambda a: a.company_id == self.company_id) + if self.receivable_accounts_only or self.payable_accounts_only: + self.onchange_type_accounts_only() + else: + self.account_ids = self.account_ids.filtered( + lambda a: a.company_id == self.company_id) + res = {'domain': {'account_ids': [], + 'partner_ids': []}} + if not self.company_id: + return res + else: + res['domain']['account_ids'] += [ + ('company_id', '=', self.company_id.id)] + res['domain']['partner_ids'] += [ + '|', ('company_id', '=', self.company_id.id), + ('company_id', '=', False)] + return res @api.onchange('receivable_accounts_only', 'payable_accounts_only') def onchange_type_accounts_only(self): diff --git a/account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml b/account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml index 0438f35d..5c426587 100644 --- a/account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml +++ b/account_financial_report_qweb/wizard/aged_partner_balance_wizard_view.xml @@ -23,8 +23,7 @@