From 0dc48fcb6520a8c2a0334e0f95f166222a918273 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 | 65 +++++++++++++++++++ account_loan/views/account_loan_view.xml | 12 +++- 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 account_loan/views/account_loan_lines_view.xml diff --git a/account_loan/__manifest__.py b/account_loan/__manifest__.py index 546bd175982..df5f6cf1f37 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 6bfaa381c6b..8321c942ab3 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 00000000000..8de2c09a271 --- /dev/null +++ b/account_loan/views/account_loan_lines_view.xml @@ -0,0 +1,65 @@ + + + + account.loan.lines.view + account.loan.line + + + + + + + + + + + + + + + + + + + +