Browse Source

[CHG] remove is_loan and related code

pull/36/head
houssine 5 years ago
committed by robin.keunen
parent
commit
8b66c48d2d
  1. 21
      easy_my_coop_loan/models/loan.py
  2. 1
      easy_my_coop_loan/views/loan_view.xml

21
easy_my_coop_loan/models/loan.py

@ -21,7 +21,6 @@ class LoanIssue(models.Model):
name = fields.Char(string="Name", name = fields.Char(string="Name",
translate=True) translate=True)
is_bond = fields.Boolean(string="Is a bond issue?") is_bond = fields.Boolean(string="Is a bond issue?")
is_loan = fields.Boolean(string="Is a subordinated loan issue?")
default_issue = fields.Boolean(string="Default issue") default_issue = fields.Boolean(string="Default issue")
subscription_start_date = fields.Date(string="Start date") subscription_start_date = fields.Date(string="Start date")
subscription_end_date = fields.Date(string="End date") subscription_end_date = fields.Date(string="End date")
@ -94,19 +93,7 @@ class LoanIssue(models.Model):
loan_issue.display_on_website = not loan_issue.display_on_website loan_issue.display_on_website = not loan_issue.display_on_website
@api.multi @api.multi
def get_web_loan_issues(self, is_company):
loan_issues = self.search([
('is_loan', '=', True),
('display_on_website', '=', True),
('state', '=', 'ongoing')
])
if is_company is True:
return loan_issues.filtered('by_company')
else:
return loan_issues.filtered('by_individual')
@api.multi
def get_web_bond_issues(self, is_company):
def get_web_issues(self, is_company):
bond_issues = self.search([ bond_issues = self.search([
('is_bond', '=', True), ('is_bond', '=', True),
('display_on_website', '=', True), ('display_on_website', '=', True),
@ -117,12 +104,6 @@ class LoanIssue(models.Model):
else: else:
return bond_issues.filtered('by_company') return bond_issues.filtered('by_company')
@api.multi
def get_web_issues(self, is_company):
issues = self.get_web_loan_issues(is_company)
issues = issues + self.get_web_bond_issues(is_company)
return issues
@api.multi @api.multi
def action_confirm(self): def action_confirm(self):
self.ensure_one() self.ensure_one()

1
easy_my_coop_loan/views/loan_view.xml

@ -55,7 +55,6 @@
<group> <group>
<group> <group>
<field name="name" /> <field name="name" />
<field name="is_loan" />
<field name="is_bond" /> <field name="is_bond" />
<field name="default_issue" /> <field name="default_issue" />
<field name="face_value" /> <field name="face_value" />

Loading…
Cancel
Save