From 42590853fe166fa7d80e22635219f26f1e34bed2 Mon Sep 17 00:00:00 2001 From: Alex Cuellar Date: Tue, 20 Oct 2020 22:59:30 -0500 Subject: [PATCH] [MIG] account_financial_report: Migration to 14.0 --- account_financial_report/__manifest__.py | 3 +- account_financial_report/models/__init__.py | 2 +- .../models/account_group.py | 12 +- .../report/abstract_report_xlsx.py | 166 ++++++++++----- .../report/aged_partner_balance_xlsx.py | 6 +- .../report/general_ledger_xlsx.py | 4 +- .../report/journal_ledger_xlsx.py | 18 +- .../report/open_items_xlsx.py | 4 +- account_financial_report/report/vat_report.py | 2 +- account_financial_report/reports.xml | 194 ++++++++---------- .../security/ir.model.access.csv | 7 + .../aged_partner_balance_wizard_view.xml | 15 +- .../wizard/general_ledger_wizard.py | 9 +- .../wizard/general_ledger_wizard_view.xml | 45 ++-- .../wizard/journal_ledger_wizard_view.xml | 11 +- .../wizard/open_items_wizard_view.xml | 34 ++- .../wizard/trial_balance_wizard.py | 9 +- .../wizard/trial_balance_wizard_view.xml | 11 +- .../wizard/vat_report_wizard_view.xml | 11 +- 19 files changed, 342 insertions(+), 221 deletions(-) create mode 100644 account_financial_report/security/ir.model.access.csv diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index 46fdc64567a9..ef7216806b0f 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -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.4.1", + "version": "14.0.1.0.0", "category": "Reporting", "summary": "OCA Financial Reports", "author": "Camptocamp SA," @@ -16,6 +16,7 @@ "website": "https://odoo-community.org/", "depends": ["account", "date_range", "report_xlsx"], "data": [ + "security/ir.model.access.csv", "wizard/aged_partner_balance_wizard_view.xml", "wizard/general_ledger_wizard_view.xml", "wizard/journal_ledger_wizard_view.xml", diff --git a/account_financial_report/models/__init__.py b/account_financial_report/models/__init__.py index 789507c962e7..afbe6974ba38 100644 --- a/account_financial_report/models/__init__.py +++ b/account_financial_report/models/__init__.py @@ -1,4 +1,4 @@ -from . import account from . import account_group +from . import account from . import account_move_line from . import ir_actions_report diff --git a/account_financial_report/models/account_group.py b/account_financial_report/models/account_group.py index f1d237f0afb3..dad94350b277 100644 --- a/account_financial_report/models/account_group.py +++ b/account_financial_report/models/account_group.py @@ -10,7 +10,7 @@ class AccountGroup(models.Model): group_child_ids = fields.One2many( comodel_name="account.group", inverse_name="parent_id", string="Child Groups" ) - level = fields.Integer(string="Level", compute="_compute_level", store=True) + level = fields.Integer(string="Level", compute="_compute_level") account_ids = fields.One2many( comodel_name="account.account", inverse_name="group_id", string="Accounts" ) @@ -31,15 +31,15 @@ def _compute_complete_name(self): else: self.complete_name = self.name - @api.depends("code_prefix", "parent_id.complete_code") + @api.depends("code_prefix_start", "parent_id.complete_code") def _compute_complete_code(self): """ Forms complete code of location from parent location to child location. """ if self.parent_id.complete_code: self.complete_code = "{}/{}".format( - self.parent_id.complete_code, self.code_prefix + self.parent_id.complete_code, self.code_prefix_start ) else: - self.complete_code = self.code_prefix + self.complete_code = self.code_prefix_start @api.depends("parent_id", "parent_id.level") def _compute_level(self): @@ -50,7 +50,7 @@ def _compute_level(self): group.level = group.parent_id.level + 1 @api.depends( - "code_prefix", + "code_prefix_start", "account_ids", "account_ids.code", "group_child_ids", @@ -60,6 +60,6 @@ def _compute_group_accounts(self): account_obj = self.env["account.account"] accounts = account_obj.search([]) for group in self: - prefix = group.code_prefix if group.code_prefix else group.name + prefix = group.code_prefix_start if group.code_prefix_start else group.name gr_acc = accounts.filtered(lambda a: a.code.startswith(prefix)).ids group.compute_account_ids = [(6, 0, gr_acc)] diff --git a/account_financial_report/report/abstract_report_xlsx.py b/account_financial_report/report/abstract_report_xlsx.py index 842f9a497fa5..5a696c73e8fb 100644 --- a/account_financial_report/report/abstract_report_xlsx.py +++ b/account_financial_report/report/abstract_report_xlsx.py @@ -10,26 +10,90 @@ class AbstractReportXslx(models.AbstractModel): _inherit = "report.report_xlsx.abstract" def __init__(self, pool, cr): + self._set_default_attributes() + + @classmethod + def _set_default_attributes(cls): # main sheet which will contains report - self.sheet = None + cls.sheet = None # columns of the report - self.columns = None + cls.columns = None # row_pos must be incremented at each writing lines - self.row_pos = None + cls.row_pos = None # Formats - self.format_right = None - self.format_left = None - self.format_right_bold_italic = None - self.format_bold = None - self.format_header_left = None - self.format_header_center = None - self.format_header_right = None - self.format_header_amount = None - self.format_amount = None - self.format_percent_bold_italic = None + cls.format_right = None + cls.format_left = None + cls.format_right_bold_italic = None + cls.format_bold = None + cls.format_header_left = None + cls.format_header_center = None + cls.format_header_right = None + cls.format_header_amount = None + cls.format_amount = None + cls.format_percent_bold_italic = None + + @classmethod + def set_sheet(cls, sheet): + cls.sheet = sheet + + @classmethod + def set_columns(cls, columns): + cls.columns = columns + + @classmethod + def set_row_pos(cls, row_pos): + cls.row_pos = row_pos + + @classmethod + def set_format_right(cls, format_right): + cls.format_right = format_right + + @classmethod + def set_format_left(cls, format_left): + cls.format_left = format_left + + @classmethod + def set_format_right_bold_italic(cls, format_right_bold_italic): + cls.format_right_bold_italic = format_right_bold_italic + + @classmethod + def set_format_bold(cls, format_bold): + cls.format_bold = format_bold + + @classmethod + def set_format_header_left(cls, format_header_left): + cls.format_header_left = format_header_left + + @classmethod + def set_format_header_center(cls, format_header_center): + cls.format_header_center = format_header_center + + @classmethod + def set_format_header_right(cls, format_header_right): + cls.format_header_right = format_header_right + + @classmethod + def set_format_header_amount(cls, format_header_amount): + cls.format_header_amount = format_header_amount + + @classmethod + def set_format_amount(cls, format_amount): + cls.format_amount = format_amount + + @classmethod + def set_format_percent_bold_italic(cls, format_percent_bold_italic): + cls.format_percent_bold_italic = format_percent_bold_italic + + @classmethod + def set_format_amount_bold(cls, format_amount_bold): + cls.format_amount_bold = format_amount_bold + + @classmethod + def set_workbook(cls, workbook): + cls.workbook = workbook def get_workbook_options(self): return {"constant_memory": True} @@ -37,16 +101,16 @@ def get_workbook_options(self): def generate_xlsx_report(self, workbook, data, objects): report = objects - self.row_pos = 0 + self.set_row_pos(0) self._define_formats(workbook) report_name = self._get_report_name(report, data=data) report_footer = self._get_report_footer() filters = self._get_report_filters(report) - self.columns = self._get_report_columns(report) - self.workbook = workbook - self.sheet = workbook.add_worksheet(report_name[:31]) + self.set_columns(self._get_report_columns(report)) + self.set_workbook(workbook) + self.set_sheet(workbook.add_worksheet(report_name[:31])) self._set_column_width() @@ -72,36 +136,42 @@ def _define_formats(self, workbook): * format_amount * format_percent_bold_italic """ - self.format_bold = workbook.add_format({"bold": True}) - self.format_right = workbook.add_format({"align": "right"}) - self.format_left = workbook.add_format({"align": "left"}) - self.format_right_bold_italic = workbook.add_format( - {"align": "right", "bold": True, "italic": True} + self.set_format_bold(workbook.add_format({"bold": True})) + self.set_format_right(workbook.add_format({"align": "right"})) + self.set_format_left(workbook.add_format({"align": "left"})) + self.set_format_right_bold_italic( + workbook.add_format({"align": "right", "bold": True, "italic": True}) ) - self.format_header_left = workbook.add_format( - {"bold": True, "border": True, "bg_color": "#FFFFCC"} + self.set_format_header_left( + workbook.add_format({"bold": True, "border": True, "bg_color": "#FFFFCC"}) ) - self.format_header_center = workbook.add_format( - {"bold": True, "align": "center", "border": True, "bg_color": "#FFFFCC"} + self.set_format_header_center( + workbook.add_format( + {"bold": True, "align": "center", "border": True, "bg_color": "#FFFFCC"} + ) ) - self.format_header_right = workbook.add_format( - {"bold": True, "align": "right", "border": True, "bg_color": "#FFFFCC"} + self.set_format_header_right( + workbook.add_format( + {"bold": True, "align": "right", "border": True, "bg_color": "#FFFFCC"} + ) ) - self.format_header_amount = workbook.add_format( - {"bold": True, "border": True, "bg_color": "#FFFFCC"} + self.set_format_header_amount( + workbook.add_format({"bold": True, "border": True, "bg_color": "#FFFFCC"}) ) - currency_id = self.env["res.company"]._get_user_currency() + currency_id = ( + self.env.company.currency_id + ) # self.env["res.company"]._get_user_currency() self.format_header_amount.set_num_format( "#,##0." + "0" * currency_id.decimal_places ) - self.format_amount = workbook.add_format() + self.set_format_amount(workbook.add_format()) self.format_amount.set_num_format("#,##0." + "0" * currency_id.decimal_places) - self.format_amount_bold = workbook.add_format({"bold": True}) + self.set_format_amount_bold(workbook.add_format({"bold": True})) self.format_amount_bold.set_num_format( "#,##0." + "0" * currency_id.decimal_places ) - self.format_percent_bold_italic = workbook.add_format( - {"bold": True, "italic": True} + self.set_format_percent_bold_italic( + workbook.add_format({"bold": True, "italic": True}) ) self.format_percent_bold_italic.set_num_format("#,##0.00%") @@ -124,14 +194,14 @@ def _write_report_title(self, title): title, self.format_bold, ) - self.row_pos += 3 + self.set_row_pos(self.row_pos + 3) def _write_report_footer(self, footer): """Write report footer . Columns are defined with `_get_report_columns` method. """ if footer: - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) self.sheet.merge_range( self.row_pos, 0, @@ -140,7 +210,7 @@ def _write_report_footer(self, footer): footer, self.format_left, ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def _write_filters(self, filters): """Write one line per filters on starting on current line. @@ -169,8 +239,8 @@ def _write_filters(self, filters): col_value + col_count_filter_value - 1, value, ) - self.row_pos += 1 - self.row_pos += 2 + self.set_row_pos(self.row_pos + 1) + self.set_row_pos(self.row_pos + 2) def write_array_title(self, title): """Write array title on current line using all defined columns width. @@ -184,7 +254,7 @@ def write_array_title(self, title): title, self.format_bold, ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_array_header(self): """Write array header on current line using all defined columns name. @@ -194,7 +264,7 @@ def write_array_header(self): self.sheet.write( self.row_pos, col_pos, column["header"], self.format_header_center ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_line(self, line_object): """Write a line on current line using all defined columns field name. @@ -234,7 +304,7 @@ def write_line(self, line_object): self.sheet.write_number( self.row_pos, col_pos, float(value), format_amt ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_line_from_dict(self, line_dict): """Write a line on current line""" @@ -278,7 +348,7 @@ def write_line_from_dict(self, line_dict): self.sheet.write_string( self.row_pos, col_pos, value or "", self.format_right ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_initial_balance(self, my_object, label): """Write a specific initial balance line on current line @@ -311,7 +381,7 @@ def write_initial_balance(self, my_object, label): self.sheet.write_string( self.row_pos, col_pos, value.name or "", self.format_right ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_initial_balance_from_dict(self, my_object, label): """Write a specific initial balance line on current line @@ -344,7 +414,7 @@ def write_initial_balance_from_dict(self, my_object, label): self.sheet.write_string( self.row_pos, col_pos, value.name or "", self.format_right ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_ending_balance(self, my_object, name, label): """Write a specific ending balance line on current line @@ -393,7 +463,7 @@ def write_ending_balance(self, my_object, name, label): value.name or "", self.format_header_right, ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def write_ending_balance_from_dict(self, my_object, name, label): """Write a specific ending balance line on current line @@ -443,7 +513,7 @@ def write_ending_balance_from_dict(self, my_object, name, label): self.sheet.write_string( self.row_pos, col_pos, value or "", self.format_header_right ) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def _get_currency_amt_format(self, line_object): """ Return amount format specific for each currency. """ diff --git a/account_financial_report/report/aged_partner_balance_xlsx.py b/account_financial_report/report/aged_partner_balance_xlsx.py index fc25b61dced9..262fe99086eb 100644 --- a/account_financial_report/report/aged_partner_balance_xlsx.py +++ b/account_financial_report/report/aged_partner_balance_xlsx.py @@ -217,7 +217,7 @@ def _generate_report_content(self, workbook, report, data): ) # 2 lines break - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) else: # For each account for account in aged_partner_balance: @@ -264,7 +264,7 @@ def _generate_report_content(self, workbook, report, data): ) # 2 lines break - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) def write_ending_balance_from_dict(self, my_object): """ @@ -312,4 +312,4 @@ def write_account_footer_from_dict( else: self.sheet.write_string(self.row_pos, col_pos, "", string_format) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) diff --git a/account_financial_report/report/general_ledger_xlsx.py b/account_financial_report/report/general_ledger_xlsx.py index c57c24d386bf..3e0d25c30eeb 100644 --- a/account_financial_report/report/general_ledger_xlsx.py +++ b/account_financial_report/report/general_ledger_xlsx.py @@ -296,7 +296,7 @@ def _generate_report_content(self, workbook, report, data): self.write_ending_balance_from_dict(partner) # Line break - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) if not filter_partner_ids: account.update( @@ -317,7 +317,7 @@ def _generate_report_content(self, workbook, report, data): self.write_ending_balance_from_dict(account) # 2 lines break - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) def write_initial_balance_from_dict(self, my_object): """Specific function to write initial balance for General Ledger""" diff --git a/account_financial_report/report/journal_ledger_xlsx.py b/account_financial_report/report/journal_ledger_xlsx.py index 104c531e0c05..61637957f72c 100644 --- a/account_financial_report/report/journal_ledger_xlsx.py +++ b/account_financial_report/report/journal_ledger_xlsx.py @@ -195,14 +195,14 @@ def _generate_journal_taxes_summary(self, workbook, ledger): self._generate_taxes_summary(workbook, sheet_name, ledger["tax_lines"]) def _generate_moves_content(self, workbook, sheet_name, report, res_data, moves): - self.workbook = workbook - self.sheet = workbook.add_worksheet(sheet_name) + self.set_workbook(workbook) + self.set_sheet(workbook.add_worksheet(sheet_name)) self._set_column_width() - self.row_pos = 1 + self.set_row_pos(self.row_pos + 1) self.write_array_title(sheet_name) - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) self.write_array_header() account_ids_data = res_data["account_ids_data"] @@ -233,15 +233,15 @@ def _generate_moves_content(self, workbook, sheet_name, report, res_data, moves) ), ) self.write_line_from_dict(line) - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) def _generate_taxes_summary(self, workbook, sheet_name, tax_lines_dict): - self.workbook = workbook - self.sheet = workbook.add_worksheet(sheet_name) + self.set_workbook(workbook) + self.set_sheet(workbook.add_worksheet(sheet_name)) - self.row_pos = 1 + self.set_row_pos(1) self.write_array_title(sheet_name) - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) def _get_partner_name(self, partner_id, partner_data): if partner_id in partner_data.keys(): diff --git a/account_financial_report/report/open_items_xlsx.py b/account_financial_report/report/open_items_xlsx.py index 653457756b79..e288696b4fe8 100644 --- a/account_financial_report/report/open_items_xlsx.py +++ b/account_financial_report/report/open_items_xlsx.py @@ -160,7 +160,7 @@ def _generate_report_content(self, workbook, report, data): ) # Line break - self.row_pos += 1 + self.set_row_pos(self.row_pos + 1) else: # Display array header for move lines self.write_array_header() @@ -182,7 +182,7 @@ def _generate_report_content(self, workbook, report, data): ) # 2 lines break - self.row_pos += 2 + self.set_row_pos(self.row_pos + 2) def write_ending_balance_from_dict( self, my_object, type_object, total_amount, account_id=False, partner_id=False diff --git a/account_financial_report/report/vat_report.py b/account_financial_report/report/vat_report.py index 0b61bbb43a97..16e398472715 100644 --- a/account_financial_report/report/vat_report.py +++ b/account_financial_report/report/vat_report.py @@ -65,7 +65,7 @@ def _get_vat_report_data(self, company_id, date_from, date_to, only_posted_moves "tax_line_id", "tax_ids", "analytic_tag_ids", - "tag_ids", + # "tag_ids", ] tax_move_lines = self.env["account.move.line"].search_read( domain=tax_domain, diff --git a/account_financial_report/reports.xml b/account_financial_report/reports.xml index f6d13a235369..bb359183e323 100644 --- a/account_financial_report/reports.xml +++ b/account_financial_report/reports.xml @@ -2,119 +2,101 @@ - - + + General Ledger + general.ledger.report.wizard + qweb-pdf + account_financial_report.general_ledger + account_financial_report.general_ledger + + + General Ledger + general.ledger.report.wizard + qweb-html + account_financial_report.general_ledger + account_financial_report.general_ledger + - - + + ournal Ledger + journal.ledger.report.wizard + qweb-pdf + account_financial_report.journal_ledger + account_financial_report.journal_ledger + + + Journal Ledger + journal.ledger.report.wizard + qweb-html + account_financial_report.journal_ledger + account_financial_report.journal_ledger + - - + + Trial Balance + trial.balance.report.wizard + qweb-pdf + account_financial_report.trial_balance + account_financial_report.trial_balance + + + Trial Balance + trial.balance.report.wizard + qweb-html + account_financial_report.trial_balance + account_financial_report.trial_balance + - - + + Open Items + open.items.report.wizard + qweb-pdf + account_financial_report.open_items + account_financial_report.open_items + + + Open Items + open.items.report.wizard + qweb-html + account_financial_report.open_items + account_financial_report.open_items + - - + Aged Partner Balance + aged.partner.balance.report.wizard + qweb-pdf + account_financial_report.aged_partner_balance + account_financial_report.aged_partner_balance + + + model="ir.actions.report" + > + Aged Partner Balance + aged.partner.balance.report.wizard + qweb-html + account_financial_report.aged_partner_balance + account_financial_report.aged_partner_balance + - - + + VAT Report + vat.report.wizard + qweb-pdf + account_financial_report.vat_report + account_financial_report.vat_report + + + VAT Report + vat.report.wizard + qweb-html + account_financial_report.vat_report + account_financial_report.vat_report + Account financial report qweb paperformat diff --git a/account_financial_report/security/ir.model.access.csv b/account_financial_report/security/ir.model.access.csv new file mode 100644 index 000000000000..9416c699812f --- /dev/null +++ b/account_financial_report/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_aged_partner_balance_report_wizard,access_aged_partner_balance_report_wizard,model_aged_partner_balance_report_wizard,base.group_user,1,1,1,1 +access_general_ledger_report_wizard,access_general_ledger_report_wizard,model_general_ledger_report_wizard,base.group_user,1,1,1,1 +access_journal_ledger_report_wizard,access_journal_ledger_report_wizard,model_journal_ledger_report_wizard,base.group_user,1,1,1,1 +access_open_items_report_wizard,access_open_items_report_wizard,model_open_items_report_wizard,base.group_user,1,1,1,1 +access_trial_balance_report_wizard,access_trial_balance_report_wizard,model_trial_balance_report_wizard,base.group_user,1,1,1,1 +access_vat_report_wizard,access_vat_report_wizard,model_vat_report_wizard,base.group_user,1,1,1,1 diff --git a/account_financial_report/wizard/aged_partner_balance_wizard_view.xml b/account_financial_report/wizard/aged_partner_balance_wizard_view.xml index 172288897015..634d2631dd23 100644 --- a/account_financial_report/wizard/aged_partner_balance_wizard_view.xml +++ b/account_financial_report/wizard/aged_partner_balance_wizard_view.xml @@ -86,12 +86,11 @@ - + + Aged Partner Balance + aged.partner.balance.report.wizard + form + + new + diff --git a/account_financial_report/wizard/general_ledger_wizard.py b/account_financial_report/wizard/general_ledger_wizard.py index dcf8bbad24b2..63a9263e70f4 100644 --- a/account_financial_report/wizard/general_ledger_wizard.py +++ b/account_financial_report/wizard/general_ledger_wizard.py @@ -12,6 +12,7 @@ from odoo import _, api, fields, models from odoo.exceptions import ValidationError +from odoo.tools import date_utils class GeneralLedgerReportWizard(models.TransientModel): @@ -146,8 +147,12 @@ def _default_foreign_currency(self): def _compute_fy_start_date(self): for wiz in self: if wiz.date_from: - res = self.company_id.compute_fiscalyear_dates(wiz.date_from) - wiz.fy_start_date = res["date_from"] + date_from, date_to = date_utils.get_fiscal_year( + wiz.date_from, + day=self.company_id.fiscalyear_last_day, + month=int(self.company_id.fiscalyear_last_month), + ) + wiz.fy_start_date = date_from else: wiz.fy_start_date = False diff --git a/account_financial_report/wizard/general_ledger_wizard_view.xml b/account_financial_report/wizard/general_ledger_wizard_view.xml index 8e3c164df786..0662428debc3 100644 --- a/account_financial_report/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report/wizard/general_ledger_wizard_view.xml @@ -153,26 +153,31 @@ - + + General Ledger + general.ledger.report.wizard + form + + new + - + model="ir.actions.act_window" + > + General Ledger + general.ledger.report.wizard + + form + + + + new + diff --git a/account_financial_report/wizard/journal_ledger_wizard_view.xml b/account_financial_report/wizard/journal_ledger_wizard_view.xml index d56603224b2b..d0660c1f0036 100644 --- a/account_financial_report/wizard/journal_ledger_wizard_view.xml +++ b/account_financial_report/wizard/journal_ledger_wizard_view.xml @@ -64,12 +64,19 @@ - + /--> + + Journal Ledger + journal.ledger.report.wizard + form + + new + diff --git a/account_financial_report/wizard/open_items_wizard_view.xml b/account_financial_report/wizard/open_items_wizard_view.xml index b7460677eb77..090244a9071a 100644 --- a/account_financial_report/wizard/open_items_wizard_view.xml +++ b/account_financial_report/wizard/open_items_wizard_view.xml @@ -87,16 +87,23 @@ - + /--> + + Open Itemsr + open.items.report.wizard + form + + new + - + /--> + + Open Items Partner + open.items.report.wizard + + form + + + + new + diff --git a/account_financial_report/wizard/trial_balance_wizard.py b/account_financial_report/wizard/trial_balance_wizard.py index 483998bc719b..177531bc7714 100644 --- a/account_financial_report/wizard/trial_balance_wizard.py +++ b/account_financial_report/wizard/trial_balance_wizard.py @@ -6,6 +6,7 @@ from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError +from odoo.tools import date_utils class TrialBalanceReportWizard(models.TransientModel): @@ -118,8 +119,12 @@ def _check_show_hierarchy_level(self): def _compute_fy_start_date(self): for wiz in self: if wiz.date_from: - res = self.company_id.compute_fiscalyear_dates(wiz.date_from) - wiz.fy_start_date = res["date_from"] + date_from, date_to = date_utils.get_fiscal_year( + wiz.date_from, + day=self.company_id.fiscalyear_last_day, + month=int(self.company_id.fiscalyear_last_month), + ) + wiz.fy_start_date = date_from else: wiz.fy_start_date = False diff --git a/account_financial_report/wizard/trial_balance_wizard_view.xml b/account_financial_report/wizard/trial_balance_wizard_view.xml index b462d5552995..084cb49c5d8b 100644 --- a/account_financial_report/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report/wizard/trial_balance_wizard_view.xml @@ -147,12 +147,19 @@ - + /--> + + Trial Balance + trial.balance.report.wizard + form + + new + diff --git a/account_financial_report/wizard/vat_report_wizard_view.xml b/account_financial_report/wizard/vat_report_wizard_view.xml index 7421a4dc1f5b..f3ed654383be 100644 --- a/account_financial_report/wizard/vat_report_wizard_view.xml +++ b/account_financial_report/wizard/vat_report_wizard_view.xml @@ -50,12 +50,19 @@ - + /--> + + VAT Report + vat.report.wizard + form + + new +