Browse Source

[PEP8] fix pep8

pull/134/head
houssine 4 years ago
parent
commit
315e63ddec
  1. 20
      easy_my_coop_loan_account/models/interest_line.py
  2. 8
      easy_my_coop_loan_account/models/loan_issue_line.py

20
easy_my_coop_loan_account/models/interest_line.py

@ -1,8 +1,6 @@
# Copyright 2020 Coop IT Easy SCRL fs # Copyright 2020 Coop IT Easy SCRL fs
# Houssine BAKKALI <houssine@coopiteasy.be> # Houssine BAKKALI <houssine@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models from odoo import api, fields, models
@ -91,18 +89,18 @@ class LoanInterestLine(models.Model):
company = line.line.company_id company = line.line.company_id
move = line.create_move(date) 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, line.write({"loan_due_fy_move": move.id,
"state": "due_fy"}) "state": "due_fy"})

8
easy_my_coop_loan_account/models/loan_issue_line.py

@ -38,19 +38,19 @@ class LoanIssueLine(models.Model):
def create_waiting_payment_move(self): def create_waiting_payment_move(self):
move_line_obj = self.env["account.move.line"] move_line_obj = self.env["account.move.line"]
for line in self: for line in self:
company = line.company_id
comp = line.company_id
move = self.create_move( move = self.create_move(
line, line,
date.today(), date.today(),
company.awaiting_loan_payment_journal.id,
comp.awaiting_loan_payment_journal.id,
) )
loan_vals = line.get_loan_move_line(move.id) loan_vals = line.get_loan_move_line(move.id)
loaner_vals = line.get_loan_move_line(move.id) loaner_vals = line.get_loan_move_line(move.id)
loan_vals["account_id"] = company.debt_long_term_account.id
loan_vals["account_id"] = comp.debt_long_term_account.id
loan_vals["credit"] = line.amount loan_vals["credit"] = line.amount
loaner_vals["account_id"] = company.awaiting_loan_payment_account.id
loaner_vals["account_id"] = comp.awaiting_loan_payment_account.id
loaner_vals["debit"] = line.amount loaner_vals["debit"] = line.amount
move_line_obj.create([loan_vals, loaner_vals]) move_line_obj.create([loan_vals, loaner_vals])

Loading…
Cancel
Save