Skip to content

Commit

Permalink
[ADD][card_installment]: Updating card_installment.
Browse files Browse the repository at this point in the history
  • Loading branch information
devodoo88 committed Nov 27, 2023
1 parent 6169646 commit 6ce12b1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions card_installment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'data/account_card.xml',
'data/decimal_installment_coeficent.xml',
'views/account_card.xml',
'views/product_product_views.xml',
],
'demo': [
'demo/product_product.xml',
Expand Down
1 change: 1 addition & 0 deletions card_installment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import res_company
from . import account_card
from . import account_card_installment
from . import product_product
2 changes: 2 additions & 0 deletions card_installment/models/account_card_installment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class AccountCardInstallment(models.Model):
default=True
)

financial_surcharge = fields.Float(string='Financial charge')

def name_get(self):
result = []
for record in self:
Expand Down
10 changes: 10 additions & 0 deletions card_installment/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import models, fields, api


class ProductProduct(models.Model):
_inherit = 'product.product'

is_financial_charge = fields.Boolean(string="Recargo financiero?")
11 changes: 6 additions & 5 deletions card_installment/views/account_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
<group string="Installment plan">
<field name="installment_ids" colspan="2" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="installment"/>
<field name="divisor" optional="show"/>
<field name="surcharge_coefficient"/>
<field name="bank_discount" optional="hide"/>
<field name="name" string="Nombre"/>
<field name="installment" string="Cuotas"/>
<field name="financial_surcharge"/>
<field name="divisor" optional="show" invisible="1"/>
<field name="surcharge_coefficient" invisible="1"/>
<field name="bank_discount" optional="hide" invisible="1"/>
</tree>
</field>
</group>
Expand Down
15 changes: 15 additions & 0 deletions card_installment/views/product_product_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<odoo>
<data>
<record id='product_product_financial_charge_form' model='ir.ui.view'>
<field name="name">product.product.financial.charge.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="categ_id" position="before">
<field name="is_financial_charge" attrs="{'invisible': [('detailed_type', '!=', 'service')]}"/>
</field>
</field>
</record>
</data>
</odoo>

0 comments on commit 6ce12b1

Please sign in to comment.