From dc8f06cacbe29cfc87df6fbc0ab2b89fb5c0d863 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/models/account_loan_line.py | 21 ++++++ account_loan/static/description/index.html | 10 +-- .../views/account_loan_lines_view.xml | 65 +++++++++++++++++++ account_loan/views/account_loan_view.xml | 12 +++- 5 files changed, 102 insertions(+), 7 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 b2fa61f0..fe9dc08d 100644 --- a/account_loan/__manifest__.py +++ b/account_loan/__manifest__.py @@ -19,6 +19,7 @@ "views/account_loan_view.xml", "views/account_move_view.xml", "views/res_partner.xml", + "views/account_loan_lines_view.xml", ], "installable": True, "maintainers": ["etobella"], diff --git a/account_loan/models/account_loan_line.py b/account_loan/models/account_loan_line.py index f5457714..4ca3f65a 100644 --- a/account_loan/models/account_loan_line.py +++ b/account_loan/models/account_loan_line.py @@ -25,10 +25,31 @@ 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, ) + 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", + ) loan_type = fields.Selection( related="loan_id.loan_type", readonly=True, diff --git a/account_loan/static/description/index.html b/account_loan/static/description/index.html index 8389bff4..7247a68f 100644 --- a/account_loan/static/description/index.html +++ b/account_loan/static/description/index.html @@ -1,20 +1,20 @@ - + - + Account Loan management