Browse Source

Merge pull request #48 from coopiteasy/12.0-payment-date

12.0 payment date
pull/49/head
Houssine BAKKALI 5 years ago
committed by GitHub
parent
commit
cc642c21b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      easy_my_coop_loan/models/__init__.py
  2. 4
      easy_my_coop_loan/models/interest_line.py
  3. 11
      easy_my_coop_loan/models/loan.py
  4. 3
      easy_my_coop_loan/models/loan_issue_line.py
  5. 10
      easy_my_coop_loan/models/mail_template.py
  6. 3
      easy_my_coop_loan/models/partner.py
  7. 18
      easy_my_coop_loan/views/loan_view.xml

1
easy_my_coop_loan/models/__init__.py

@ -2,4 +2,3 @@ from . import loan
from . import loan_issue_line from . import loan_issue_line
from . import interest_line from . import interest_line
from . import partner from . import partner
from . import mail_template

4
easy_my_coop_loan/models/interest_line.py

@ -1,3 +1,7 @@
# Copyright 2019 Coop IT Easy SCRL fs
# Houssine BAKKALI <houssine@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models from odoo import fields, models

11
easy_my_coop_loan/models/loan.py

@ -1,3 +1,7 @@
# Copyright 2019 Coop IT Easy SCRL fs
# Houssine BAKKALI <houssine@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging import logging
from odoo import api, fields, models, _ from odoo import api, fields, models, _
@ -25,6 +29,7 @@ class LoanIssue(models.Model):
subscription_end_date = fields.Date(string="End date subscription period") subscription_end_date = fields.Date(string="End date subscription period")
user_id = fields.Many2one('res.users', user_id = fields.Many2one('res.users',
string="Responsible") string="Responsible")
loan_start_date = fields.Date(string="Loan start date")
term_date = fields.Date(string="Term date") term_date = fields.Date(string="Term date")
loan_term = fields.Float(string="Duration of the loan in month") loan_term = fields.Float(string="Duration of the loan in month")
rate = fields.Float(string="Interest rate") rate = fields.Float(string="Interest rate")
@ -49,6 +54,7 @@ class LoanIssue(models.Model):
interest_payment = fields.Selection([('end', 'End'), interest_payment = fields.Selection([('end', 'End'),
('yearly', 'Yearly')], ('yearly', 'Yearly')],
string="Interest payment") string="Interest payment")
interest_payment_info = fields.Char(string="Yearly payment on")
loan_issue_lines = fields.One2many('loan.issue.line', loan_issue_lines = fields.One2many('loan.issue.line',
'loan_issue_id', 'loan_issue_id',
string="Loan issue lines") string="Loan issue lines")
@ -85,11 +91,6 @@ class LoanIssue(models.Model):
max_amount = self.max_amount_person - already_subscribed max_amount = self.max_amount_person - already_subscribed
return max_amount return max_amount
@api.multi
def toggle_display(self):
for loan_issue in self:
loan_issue.display_on_website = not loan_issue.display_on_website
@api.multi @api.multi
def get_web_issues(self, is_company): def get_web_issues(self, is_company):
bond_issues = self.search([ bond_issues = self.search([

3
easy_my_coop_loan/models/loan_issue_line.py

@ -1,3 +1,6 @@
# Copyright 2019 Coop IT Easy SCRL fs
# Houssine BAKKALI <houssine@coopiteasy.be>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from datetime import datetime from datetime import datetime

10
easy_my_coop_loan/models/mail_template.py

@ -1,10 +0,0 @@
from odoo import models
class MailTemplate(models.Model):
_inherit = "mail.template"
# def init(self):
# for template_id in EMAIL_TEMPLATE_IDS:
# mail_template = self.env.ref(template_id)
# mail_template.easy_my_coop = True

3
easy_my_coop_loan/models/partner.py

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Coop IT Easy SCRL fs # Copyright 2019 Coop IT Easy SCRL fs
# Robin Keunen <robin@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 odoo import fields, models, api from odoo import fields, models, api

18
easy_my_coop_loan/views/loan_view.xml

@ -8,6 +8,7 @@
<field name="name" /> <field name="name" />
<field name="subscription_start_date" /> <field name="subscription_start_date" />
<field name="subscription_end_date" /> <field name="subscription_end_date" />
<field name="loan_start_date" />
<field name="term_date" /> <field name="term_date" />
<field name="loan_term" /> <field name="loan_term" />
<field name="rate" /> <field name="rate" />
@ -47,15 +48,18 @@
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,ongoing,closed"/> <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,ongoing,closed"/>
</header> </header>
<sheet> <sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_display" type="object"
class="oe_stat_button" icon="fa-globe">
<field name="display_on_website" widget="website_button"/>
</button>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Name"/>
<h1><field name="name" placeholder="Loan issue Name"/></h1>
<div name="options">
<div>
<field name="display_on_website"/>
<label for="display_on_website"/>
</div>
</div>
</div> </div>
<group> <group>
<group> <group>
<field name="name" />
<field name="default_issue" /> <field name="default_issue" />
<field name="face_value" /> <field name="face_value" />
<field name="minimum_amount" /> <field name="minimum_amount" />
@ -83,9 +87,11 @@
</div> </div>
<field name="subscription_start_date" /> <field name="subscription_start_date" />
<field name="subscription_end_date" /> <field name="subscription_end_date" />
<field name="loan_start_date" />
<field name="term_date" /> <field name="term_date" />
<field name="loan_term" /> <field name="loan_term" />
<field name="interest_payment" widget="selection" /> <field name="interest_payment" widget="selection" />
<field name="interest_payment_info" attrs="{'invisible':[('interest_payment','not in',['end','yearly'])]}" />
</group> </group>
</group> </group>
<notebook> <notebook>

Loading…
Cancel
Save