|
|
@ -1,8 +1,6 @@ |
|
|
|
# Copyright 2020 Coop IT Easy SCRL fs |
|
|
|
# Houssine BAKKALI <houssine@coopiteasy.be> |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|
|
|
from dateutil.relativedelta import relativedelta |
|
|
|
|
|
|
|
from odoo import api, fields, models |
|
|
|
|
|
|
|
|
|
|
@ -91,18 +89,18 @@ class LoanInterestLine(models.Model): |
|
|
|
company = line.line.company_id |
|
|
|
move = line.create_move(date) |
|
|
|
|
|
|
|
debit_vals = line.get_move_line(line.partner_id) |
|
|
|
credit_vals = line.get_move_line(line.partner_id) |
|
|
|
deb_vals = line.get_move_line(line.partner_id) |
|
|
|
cred_vals = line.get_move_line(line.partner_id) |
|
|
|
|
|
|
|
debit_vals["debit"] = line.due_loan_amount |
|
|
|
debit_vals["date"] = date |
|
|
|
debit_vals["account_id"] = company.debt_long_term_account.id |
|
|
|
deb_vals["debit"] = line.due_loan_amount |
|
|
|
deb_vals["date"] = date |
|
|
|
deb_vals["account_id"] = company.debt_long_term_account.id |
|
|
|
|
|
|
|
credit_vals["credit"] = line.due_loan_amount |
|
|
|
credit_vals["credit"] = date |
|
|
|
credit_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
|
cred_vals["credit"] = line.due_loan_amount |
|
|
|
cred_vals["credit"] = date |
|
|
|
cred_vals["account_id"] = company.debt_long_term_fy_account.id |
|
|
|
|
|
|
|
self.env["account.move.line"].create([debit_vals, credit_vals]) |
|
|
|
self.env["account.move.line"].create([deb_vals, cred_vals]) |
|
|
|
|
|
|
|
line.write({"loan_due_fy_move": move.id, |
|
|
|
"state": "due_fy"}) |
|
|
|