Browse Source

[IMP] add payment date info and some refact

pull/48/head
houssine 5 years ago
committed by robin.keunen
parent
commit
e8384a26e0
  1. 11
      easy_my_coop_loan/models/loan.py
  2. 18
      easy_my_coop_loan/views/loan_view.xml

11
easy_my_coop_loan/models/loan.py

@ -49,8 +49,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")
payment_date = fields.Date(string="Interest payment date")
yearly_payement_on = fields.Char(string="Yearly payment on")
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")
@ -87,10 +86,10 @@ 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
# 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):

18
easy_my_coop_loan/views/loan_view.xml

@ -47,15 +47,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" />
@ -86,8 +89,7 @@
<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="payment_date" attrs="{'invisible':[('interest_payment','!=','end')]}" />
<field name="yearly_payement_on" attrs="{'invisible':[('interest_payment','!=','yearly')]}" />
<field name="interest_payment_info" attrs="{'invisible':[('interest_payment','not in',['end','yearly'])]}" />
</group> </group>
</group> </group>
<notebook> <notebook>

Loading…
Cancel
Save