From 65d5306316ba930c67940fc499c8260f5c007806 Mon Sep 17 00:00:00 2001 From: jcoux Date: Fri, 29 Jul 2016 15:01:48 +0200 Subject: [PATCH] Global review, fix and make missing fields translatable --- .../report/aged_partner_balance.py | 18 +++++++------ .../report/general_ledger.py | 4 ++- .../report/open_items.py | 2 ++ .../report/trial_balance.py | 10 ++++--- .../wizard/aged_partner_balance_wizard.py | 3 ++- .../aged_partner_balance_wizard_view.xml | 24 ++++++++--------- .../wizard/general_ledger_wizard.py | 9 +++++-- .../wizard/general_ledger_wizard_view.xml | 26 +++++++++---------- .../wizard/open_items_wizard.py | 3 ++- .../wizard/open_items_wizard_view.xml | 24 ++++++++--------- .../wizard/trial_balance_wizard.py | 9 +++++-- .../wizard/trial_balance_wizard_view.xml | 24 ++++++++--------- 12 files changed, 84 insertions(+), 72 deletions(-) diff --git a/account_financial_report_qweb/report/aged_partner_balance.py b/account_financial_report_qweb/report/aged_partner_balance.py index 3fe45ce4..190dea53 100644 --- a/account_financial_report_qweb/report/aged_partner_balance.py +++ b/account_financial_report_qweb/report/aged_partner_balance.py @@ -11,10 +11,10 @@ class AgedPartnerBalanceReport(models.TransientModel): The class hierarchy is : * AgedPartnerBalanceReport - ** AgedPartnerBalanceAccount - *** AgedPartnerBalancePartner - **** AgedPartnerBalanceLine - **** AgedPartnerBalanceMoveLine + ** AgedPartnerBalanceReportAccount + *** AgedPartnerBalanceReportPartner + **** AgedPartnerBalanceReportLine + **** AgedPartnerBalanceReportMoveLine If "show_move_line_details" is selected """ @@ -38,7 +38,7 @@ class AgedPartnerBalanceReport(models.TransientModel): ) -class AgedPartnerBalanceAccount(models.TransientModel): +class AgedPartnerBalanceReportAccount(models.TransientModel): _name = 'report_aged_partner_balance_qweb_account' _order = 'code ASC' @@ -81,7 +81,7 @@ class AgedPartnerBalanceAccount(models.TransientModel): ) -class AgedPartnerBalancePartner(models.TransientModel): +class AgedPartnerBalanceReportPartner(models.TransientModel): _name = 'report_aged_partner_balance_qweb_partner' @@ -125,7 +125,7 @@ ORDER BY """ -class AgedPartnerBalanceLine(models.TransientModel): +class AgedPartnerBalanceReportLine(models.TransientModel): _name = 'report_aged_partner_balance_qweb_line' @@ -146,7 +146,7 @@ class AgedPartnerBalanceLine(models.TransientModel): older = fields.Float(digits=(16, 2)) -class AgedPartnerBalanceMoveLine(models.TransientModel): +class AgedPartnerBalanceReportMoveLine(models.TransientModel): _name = 'report_aged_partner_balance_qweb_move_line' @@ -222,6 +222,8 @@ class AgedPartnerBalanceReportCompute(models.TransientModel): self._inject_move_line_values() self._inject_move_line_values(only_empty_partner_line=True) self._compute_accounts_cumul() + # Refresh cache because all data are computed with SQL requests + self.refresh() def _inject_account_values(self): """Inject report values for report_aged_partner_balance_qweb_account""" diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index 3c9524fd..035cc4de 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -208,6 +208,8 @@ class GeneralLedgerReportCompute(models.TransientModel): self._inject_line_centralized_values() # Compute display flag self._compute_has_second_currency() + # Refresh cache because all data are computed with SQL requests + self.refresh() def _inject_account_values(self): """Inject report values for report_general_ledger_qweb_account.""" @@ -896,7 +898,7 @@ SELECT NOW() AS create_date, ml.date, a.code AS account, - 'Centralized Entries' AS label, + '""" + _('Centralized Entries') + """' AS label, ml.debit AS debit, ml.credit AS credit, ra.initial_balance + ( diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py index 9488deb0..ba82ddbf 100644 --- a/account_financial_report_qweb/report/open_items.py +++ b/account_financial_report_qweb/report/open_items.py @@ -169,6 +169,8 @@ class OpenItemsReportCompute(models.TransientModel): ) # Compute display flag self._compute_has_second_currency() + # Refresh cache because all data are computed with SQL requests + self.refresh() def _inject_account_values(self): """Inject report values for report_open_items_qweb_account.""" diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index 5073d25a..788ae71b 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -11,8 +11,8 @@ class TrialBalanceReport(models.TransientModel): The class hierarchy is : * TrialBalanceReport - ** TrialBalanceAccount - *** TrialBalancePartner + ** TrialBalanceReportAccount + *** TrialBalanceReportPartner If "show_partner_details" is selected """ @@ -42,7 +42,7 @@ class TrialBalanceReport(models.TransientModel): ) -class TrialBalanceAccount(models.TransientModel): +class TrialBalanceReportAccount(models.TransientModel): _name = 'report_trial_balance_qweb_account' _order = 'code ASC' @@ -75,7 +75,7 @@ class TrialBalanceAccount(models.TransientModel): ) -class TrialPartnerAccount(models.TransientModel): +class TrialBalanceReportPartner(models.TransientModel): _name = 'report_trial_balance_qweb_partner' @@ -156,6 +156,8 @@ class TrialBalanceReportCompute(models.TransientModel): self._inject_account_values() if self.show_partner_details: self._inject_partner_values() + # Refresh cache because all data are computed with SQL requests + self.refresh() def _inject_account_values(self): """Inject report values for report_trial_balance_qweb_account""" 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 8bc9c121..3dfd7852 100644 --- a/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py +++ b/account_financial_report_qweb/wizard/aged_partner_balance_wizard.py @@ -16,7 +16,8 @@ class AgedPartnerBalance(models.TransientModel): company_id = fields.Many2one( comodel_name='res.company', - default=lambda self: self.env.user.company_id + default=lambda self: self.env.user.company_id, + string='Company' ) date_at = fields.Date(required=True, default=fields.Date.to_string(datetime.today())) 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 be180406..8d6c611a 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 @@ -8,10 +8,10 @@
- + - + @@ -20,14 +20,14 @@