2021-02-23 11:00:15 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
2018-02-26 12:17:24 +01:00
|
|
|
<!-- Copyright 2011 Alexis de Lattre <alexis.delattre@akretion.com>
|
|
|
|
Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
|
|
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
|
|
<odoo>
|
|
|
|
<record id="account_loan_tree" model="ir.ui.view">
|
|
|
|
<field name="name">account.loan.tree</field>
|
|
|
|
<field name="model">account.loan</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Loans">
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="name" />
|
|
|
|
<field name="company_id" />
|
|
|
|
<field name="is_leasing" />
|
|
|
|
<field name="state" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="account_loan_form" model="ir.ui.view">
|
|
|
|
<field name="name">account.loan.form</field>
|
|
|
|
<field name="model">account.loan</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Loan">
|
|
|
|
<header>
|
2021-02-23 11:00:15 +01:00
|
|
|
<button name="compute_lines" type="object" string="Compute items" />
|
|
|
|
<button
|
|
|
|
name="%(account_loan_post_action)d"
|
|
|
|
states="draft"
|
|
|
|
type="action"
|
|
|
|
string="Post"
|
|
|
|
/>
|
|
|
|
<field name="state" widget="statusbar" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</header>
|
|
|
|
<sheet>
|
|
|
|
<div class="oe_button_box">
|
2021-02-23 11:00:15 +01:00
|
|
|
<button
|
|
|
|
name="view_account_moves"
|
|
|
|
class="oe_stat_button"
|
|
|
|
icon="fa-bars"
|
|
|
|
attrs="{'invisible': [('state', '=', 'draft')]}"
|
|
|
|
type="object"
|
|
|
|
string="Moves"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
name="view_account_invoices"
|
|
|
|
class="oe_stat_button"
|
|
|
|
icon="fa-pencil-square-o"
|
|
|
|
attrs="{'invisible': ['|', ('state', '=', 'draft'), ('is_leasing', '=', False)]}"
|
|
|
|
type="object"
|
|
|
|
string="Invoices"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
name="%(account_loan_pay_amount_action)d"
|
|
|
|
class="oe_stat_button"
|
|
|
|
icon="fa-usd"
|
|
|
|
attrs="{'invisible': [('state', '!=', 'posted')]}"
|
|
|
|
type="action"
|
|
|
|
string="Pay amount"
|
|
|
|
/>
|
2018-02-26 12:17:24 +01:00
|
|
|
</div>
|
|
|
|
<h1>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="name" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</h1>
|
|
|
|
<group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="company_id" options="{'no_create': True}" />
|
|
|
|
<field name="loan_type" />
|
|
|
|
<field name="loan_amount" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="rate_type" />
|
|
|
|
<field name="rate" />
|
|
|
|
<field name="rate_period" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="partner_id" />
|
|
|
|
<field name="start_date" />
|
|
|
|
<field name="periods" />
|
|
|
|
<field name="method_period" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="is_leasing" />
|
|
|
|
<field name="round_on_end" />
|
|
|
|
<field name="payment_on_first_period" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<group attrs="{'invisible':[('state', '=', 'draft')]}">
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="pending_principal_amount" />
|
|
|
|
<field name="payment_amount" />
|
|
|
|
<field name="interests_amount" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<notebook>
|
|
|
|
<page string="Items" id="items">
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="line_ids" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</page>
|
|
|
|
<page string="Accounts" id="accounting">
|
|
|
|
<group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="journal_id" />
|
|
|
|
<field name="short_term_loan_account_id" />
|
|
|
|
<field name="journal_type" invisible="1" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="long_term_loan_account_id" />
|
|
|
|
<field name="interest_expenses_account_id" />
|
|
|
|
<field name="currency_id" invisible="1" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
</page>
|
2021-02-23 11:00:15 +01:00
|
|
|
<page
|
|
|
|
string="Leasing"
|
|
|
|
id="leasing"
|
|
|
|
attrs="{'invisible': [('is_leasing', '=', False)]}"
|
|
|
|
>
|
2018-02-26 12:17:24 +01:00
|
|
|
<group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field
|
|
|
|
name="leased_asset_account_id"
|
|
|
|
attrs="{'required': [('is_leasing', '=', True)]}"
|
|
|
|
/>
|
|
|
|
<field name="residual_amount" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field
|
|
|
|
name="product_id"
|
|
|
|
attrs="{'required': [('is_leasing', '=', True)]}"
|
|
|
|
/>
|
|
|
|
<field
|
|
|
|
name="interests_product_id"
|
|
|
|
attrs="{'required': [('is_leasing', '=', True)]}"
|
|
|
|
/>
|
|
|
|
<field name="post_invoice" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
</page>
|
|
|
|
</notebook>
|
|
|
|
</sheet>
|
|
|
|
<div class="oe_chatter">
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="message_follower_ids" widget="mail_followers" />
|
|
|
|
<field name="activity_ids" widget="mail_activity" />
|
|
|
|
<field name="message_ids" widget="mail_thread" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="account_loan_line_tree" model="ir.ui.view">
|
|
|
|
<field name="name">account.loan.line.tree</field>
|
|
|
|
<field name="model">account.loan.line</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Loan items" create="0">
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="sequence" />
|
|
|
|
<field name="date" />
|
|
|
|
<field name="rate" />
|
|
|
|
<field name="pending_principal_amount" />
|
|
|
|
<field name="payment_amount" sum="Total payments" />
|
|
|
|
<field name="principal_amount" />
|
|
|
|
<field name="interests_amount" sum="Total interests" />
|
|
|
|
<field
|
|
|
|
name="long_term_pending_principal_amount"
|
|
|
|
attrs="{'invisible': [('long_term_loan_account_id', '=', False)]}"
|
|
|
|
/>
|
|
|
|
<field
|
|
|
|
name="long_term_principal_amount"
|
|
|
|
attrs="{'invisible': [('long_term_loan_account_id', '=', False)]}"
|
|
|
|
/>
|
|
|
|
<field name="long_term_loan_account_id" invisible="1" />
|
|
|
|
<field name="loan_state" invisible="1" />
|
|
|
|
<field name="is_leasing" invisible="1" />
|
|
|
|
<field name="has_invoices" invisible="1" />
|
|
|
|
<field name="has_moves" invisible="1" />
|
|
|
|
<field name="currency_id" invisible="1" />
|
|
|
|
<button
|
|
|
|
name="view_account_values"
|
|
|
|
string="Values"
|
|
|
|
type="object"
|
|
|
|
icon="fa-eye"
|
|
|
|
attrs="{'invisible': [('has_moves', '=', False), ('has_invoices', '=', False)]}"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
name="view_process_values"
|
|
|
|
string="Process"
|
|
|
|
type="object"
|
|
|
|
icon="fa-cogs"
|
|
|
|
attrs="{'invisible': ['|', '|', ('has_moves', '=', True), ('has_invoices', '=', True), ('loan_state', '!=', 'posted')]}"
|
|
|
|
/>
|
2018-02-26 12:17:24 +01:00
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="account_loan_line_form" model="ir.ui.view">
|
|
|
|
<field name="name">account.loan.line.form</field>
|
|
|
|
<field name="model">account.loan.line</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="sequence" />
|
|
|
|
<field name="rate" />
|
|
|
|
<field name="date" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="pending_principal_amount" />
|
|
|
|
<field name="payment_amount" />
|
|
|
|
<field name="principal_amount" />
|
|
|
|
<field name="interests_amount" />
|
|
|
|
<field name="final_pending_principal_amount" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
<group>
|
2021-02-23 11:00:15 +01:00
|
|
|
<field name="long_term_pending_principal_amount" />
|
|
|
|
<field name="long_term_principal_amount" />
|
2018-02-26 12:17:24 +01:00
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
2021-02-23 11:00:15 +01:00
|
|
|
<act_window id="account_loan_action" name="Loans" res_model="account.loan" />
|
|
|
|
<menuitem
|
|
|
|
id="account_loan_menu"
|
|
|
|
parent="account.menu_finance_entries"
|
|
|
|
sequence="80"
|
|
|
|
name="Loans"
|
|
|
|
action="account_loan_action"
|
|
|
|
/>
|
2018-02-26 12:17:24 +01:00
|
|
|
</odoo>
|