From 9cf94c8e6928ac6849e44c8f9b82243df25ca57f Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 5 Jul 2016 12:46:04 +0200 Subject: [PATCH] Remove usage of header_view_get and string attribute from views issue2350 review25191002 --- move.py | 19 +------------------ view/account_balance_sheet_tree.xml | 2 +- view/account_deferral_form.xml | 2 +- view/account_deferral_tree.xml | 2 +- view/account_form.xml | 2 +- view/account_income_statement_tree.xml | 2 +- view/account_list.xml | 2 +- view/account_list2.xml | 2 +- view/account_template_form.xml | 2 +- view/account_template_list.xml | 2 +- view/account_template_tree.xml | 2 +- view/account_tree.xml | 2 +- view/account_tree2.xml | 2 +- view/account_type_form.xml | 2 +- view/account_type_list.xml | 2 +- view/account_type_template_form.xml | 2 +- view/account_type_template_list.xml | 2 +- view/account_type_template_tree.xml | 2 +- view/account_type_tree.xml | 2 +- view/aged_balance_context_form.xml | 2 +- view/aged_balance_list.xml | 2 +- view/balance_sheet_context_form.xml | 2 +- view/configuration_form.xml | 2 +- view/configuration_tax_rounding_form.xml | 2 +- view/configuration_tax_rounding_list.xml | 2 +- view/create_chart_account_form.xml | 2 +- view/create_chart_properties_form.xml | 2 +- view/create_chart_start_form.xml | 2 +- ...alyear_balance_non_deferral_start_form.xml | 2 +- view/fiscalyear_close_start_form.xml | 2 +- view/fiscalyear_form.xml | 2 +- view/fiscalyear_tree.xml | 2 +- view/general_ledger_account_context_form.xml | 2 +- view/general_ledger_account_list.xml | 2 +- view/general_ledger_line_list.xml | 2 +- view/income_statement_context_form.xml | 2 +- view/journal_form.xml | 2 +- view/journal_list_cash.xml | 2 +- view/journal_open_cash_context.xml | 2 +- view/journal_period_form.xml | 2 +- view/journal_period_tree.xml | 2 +- view/journal_tree.xml | 2 +- view/journal_type_form.xml | 2 +- view/journal_type_tree.xml | 2 +- view/journal_view_column_form.xml | 2 +- view/journal_view_column_list.xml | 2 +- view/journal_view_column_list_sequence.xml | 2 +- view/journal_view_form.xml | 2 +- view/journal_view_tree.xml | 2 +- view/move_cancel_default_form.xml | 2 +- view/move_form.xml | 2 +- view/move_line_form.xml | 2 +- view/move_line_form_move.xml | 2 +- view/move_line_list_payable_receivable.xml | 2 +- view/move_line_template_form.xml | 2 +- view/move_line_template_list.xml | 2 +- view/move_line_tree.xml | 2 +- view/move_line_tree_move.xml | 2 +- view/move_reconciliation_form.xml | 2 +- view/move_reconciliation_tree.xml | 2 +- view/move_template_create_template_form.xml | 2 +- view/move_template_form.xml | 2 +- view/move_template_keyword_form.xml | 2 +- view/move_template_keyword_list.xml | 2 +- view/move_template_keyword_list_sequence.xml | 2 +- view/move_template_list.xml | 2 +- view/move_tree.xml | 2 +- view/open_chart_start_form.xml | 2 +- view/open_journal_ask_form.xml | 2 +- view/period_form.xml | 2 +- view/period_tree.xml | 2 +- view/print_general_journal_start_form.xml | 2 +- view/reconcile_lines_writeoff_form.xml | 2 +- view/reconcile_show_form.xml | 2 +- view/tax_code_form.xml | 2 +- view/tax_code_list.xml | 2 +- view/tax_code_open_chart_start_form.xml | 2 +- view/tax_code_template_form.xml | 2 +- view/tax_code_template_tree.xml | 2 +- view/tax_code_tree.xml | 2 +- view/tax_code_tree2.xml | 2 +- view/tax_form.xml | 2 +- view/tax_group_form.xml | 2 +- view/tax_group_tree.xml | 2 +- view/tax_line_form.xml | 2 +- view/tax_line_template_form.xml | 2 +- view/tax_line_template_list.xml | 2 +- view/tax_line_tree.xml | 2 +- view/tax_list.xml | 2 +- view/tax_rule_form.xml | 2 +- view/tax_rule_line_form.xml | 2 +- view/tax_rule_line_template_form.xml | 2 +- view/tax_rule_line_template_tree.xml | 2 +- view/tax_rule_line_tree.xml | 2 +- view/tax_rule_line_tree_sequence.xml | 2 +- view/tax_rule_template_form.xml | 2 +- view/tax_rule_template_tree.xml | 2 +- view/tax_rule_tree.xml | 2 +- view/tax_template_form.xml | 2 +- view/tax_template_list.xml | 2 +- view/update_chart_start_form.xml | 2 +- view/update_chart_succeed_form.xml | 2 +- 102 files changed, 102 insertions(+), 119 deletions(-) diff --git a/move.py b/move.py index 8ec385e700..8d161a472f 100644 --- a/move.py +++ b/move.py @@ -1476,21 +1476,6 @@ class Line(ModelSQL, ModelView): default['reconciliation'] = None return super(Line, cls).copy(lines, default=default) - @classmethod - def view_header_get(cls, value, view_type='form'): - JournalPeriod = Pool().get('account.journal.period') - if (not Transaction().context.get('journal') - or not Transaction().context.get('period')): - return value - journal_periods = JournalPeriod.search([ - ('journal', '=', Transaction().context['journal']), - ('period', '=', Transaction().context['period']), - ], limit=1) - if not journal_periods: - return value - journal_period, = journal_periods - return value + ': ' + journal_period.rec_name - @classmethod def view_toolbar_get(cls): pool = Pool() @@ -1525,15 +1510,13 @@ class Line(ModelSQL, ModelView): result = super(Line, cls).fields_view_get(view_id=view_id, view_type=view_type) if view_type == 'tree' and 'journal' in Transaction().context: - title = cls.view_header_get('', view_type=view_type) journal = Journal(Transaction().context['journal']) if not journal.view: return result xml = '\n' \ - '\n' \ - % title + '\n' fields = set() for column in journal.view.columns: fields.add(column.field.name) diff --git a/view/account_balance_sheet_tree.xml b/view/account_balance_sheet_tree.xml index 4b8d9983ae..cb9a798260 100644 --- a/view/account_balance_sheet_tree.xml +++ b/view/account_balance_sheet_tree.xml @@ -1,7 +1,7 @@ - + diff --git a/view/account_deferral_form.xml b/view/account_deferral_form.xml index 7d71e49b97..f1e1337351 100644 --- a/view/account_deferral_form.xml +++ b/view/account_deferral_form.xml @@ -1,7 +1,7 @@ -
+