From df92808d79a14783b2088b495a192a20c5499fe7 Mon Sep 17 00:00:00 2001 From: "matteo.tognini" Date: Fri, 29 Sep 2023 14:58:34 +0200 Subject: [PATCH] [IMP] account_loan: add loan lines menu item --- account_loan/__manifest__.py | 1 + account_loan/model/account_loan_line.py | 21 +++++++ .../views/account_loan_lines_view.xml | 61 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 account_loan/views/account_loan_lines_view.xml diff --git a/account_loan/__manifest__.py b/account_loan/__manifest__.py index 546bd175982a..df5f6cf1f377 100644 --- a/account_loan/__manifest__.py +++ b/account_loan/__manifest__.py @@ -17,6 +17,7 @@ "wizard/account_loan_post_view.xml", "views/account_loan_view.xml", "views/account_move_view.xml", + "views/account_loan_lines_view.xml", ], "installable": True, "external_dependencies": { diff --git a/account_loan/model/account_loan_line.py b/account_loan/model/account_loan_line.py index 6bfaa381c6b4..8321c942ab38 100644 --- a/account_loan/model/account_loan_line.py +++ b/account_loan/model/account_loan_line.py @@ -25,6 +25,12 @@ class AccountLoanLine(models.Model): readonly=True, ondelete="cascade", ) + company_id = fields.Many2one( + "res.company", readonly=True, related="loan_id.company_id" + ) + partner_id = fields.Many2one( + "res.partner", readonly=True, related="loan_id.partner_id" + ) is_leasing = fields.Boolean( related="loan_id.is_leasing", readonly=True, @@ -49,6 +55,21 @@ class AccountLoanLine(models.Model): readonly=True, related="loan_id.long_term_loan_account_id", ) + journal_id = fields.Many2one( + "account.journal", + readonly=True, + related="loan_id.journal_id", + ) + short_term_loan_account_id = fields.Many2one( + "account.account", + readonly=True, + related="loan_id.short_term_loan_account_id", + ) + interest_expenses_account_id = fields.Many2one( + "account.account", + readonly=True, + related="loan_id.interest_expenses_account_id", + ) currency_id = fields.Many2one( "res.currency", related="loan_id.currency_id", diff --git a/account_loan/views/account_loan_lines_view.xml b/account_loan/views/account_loan_lines_view.xml new file mode 100644 index 000000000000..701748e1dbb6 --- /dev/null +++ b/account_loan/views/account_loan_lines_view.xml @@ -0,0 +1,61 @@ + + + + account.loan.lines.view + account.loan.line + + + + + + + + + + + + + + + + + + + + + + + + Loan Items + account.loan.line + + + + + + + + + + + + + Loan Items + ir.actions.act_window + account.loan.line + tree,pivot,graph + + {'search_default_group_by_loan_id': 1} + + +