Compare commits

...

1 Commits

Author SHA1 Message Date
robin.keunen 7909fa0e2f [ADD] emc_loan: gross interest rate 4 years ago
  1. 1
      easy_my_coop_loan/demo/coop.xml
  2. 5
      easy_my_coop_loan/models/loan.py
  3. 8
      easy_my_coop_loan/views/loan_view.xml

1
easy_my_coop_loan/demo/coop.xml

@ -13,6 +13,7 @@
<field name="term_date" eval="datetime.today() + timedelta(days=600)"/> <field name="term_date" eval="datetime.today() + timedelta(days=600)"/>
<field name="user_id" ref="easy_my_coop.res_users_manager_emc_demo"/> <field name="user_id" ref="easy_my_coop.res_users_manager_emc_demo"/>
<field name="rate">0.03</field> <field name="rate">0.03</field>
<field name="gross_rate">0.4</field>
<field name="face_value">100</field> <field name="face_value">100</field>
<field name="minimum_amount">4000</field> <field name="minimum_amount">4000</field>
<field name="maximum_amount">10000</field> <field name="maximum_amount">10000</field>

5
easy_my_coop_loan/models/loan.py

@ -33,7 +33,9 @@ class LoanIssue(models.Model):
loan_start_date = fields.Date(string="Loan start date") 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="Net Interest rate")
gross_rate = fields.Float(string="Gross Interest rate")
taxes_rate = fields.Float(string="Taxes on interest", required=True)
face_value = fields.Monetary( face_value = fields.Monetary(
string="Facial value", string="Facial value",
currency_field="company_currency_id", currency_field="company_currency_id",
@ -100,7 +102,6 @@ class LoanIssue(models.Model):
by_company = fields.Boolean(string="By company") by_company = fields.Boolean(string="By company")
by_individual = fields.Boolean(string="By individuals") by_individual = fields.Boolean(string="By individuals")
display_on_website = fields.Boolean(sting="Display on website") display_on_website = fields.Boolean(sting="Display on website")
taxes_rate = fields.Float(string="Taxes on interest", required=True)
@api.multi @api.multi
def get_max_amount(self, partner): def get_max_amount(self, partner):

8
easy_my_coop_loan/views/loan_view.xml

@ -12,6 +12,7 @@
<field name="term_date"/> <field name="term_date"/>
<field name="loan_term"/> <field name="loan_term"/>
<field name="rate"/> <field name="rate"/>
<field name="gross_rate"/>
<field name="minimum_amount"/> <field name="minimum_amount"/>
<field name="maximum_amount"/> <field name="maximum_amount"/>
<field name="subscribed_amount"/> <field name="subscribed_amount"/>
@ -87,11 +88,16 @@
</group> </group>
<group> <group>
<field name="user_id" widget="selection"/> <field name="user_id" widget="selection"/>
<label for="rate" string="Interest rate"/>
<label for="rate" string="Net Interest rate"/>
<div> <div>
<field name="rate" class="oe_inline"/> <field name="rate" class="oe_inline"/>
<span class="o_form_label oe_inline">%</span> <span class="o_form_label oe_inline">%</span>
</div> </div>
<label for="gross_rate" string="Gross Interest rate"/>
<div>
<field name="gross_rate" class="oe_inline"/>
<span class="o_form_label oe_inline">%</span>
</div>
<label for="taxes_rate" string="Taxes on interest"/> <label for="taxes_rate" string="Taxes on interest"/>
<div> <div>
<field name="taxes_rate" class="oe_inline"/> <field name="taxes_rate" class="oe_inline"/>

Loading…
Cancel
Save