Andhitia Rama
8 years ago
17 changed files with 175 additions and 149 deletions
-
5partner_financial_risk/README.rst
-
2partner_financial_risk/__init__.py
-
7partner_financial_risk/__openerp__.py
-
28partner_financial_risk/data/partner_financial_risk_data.xml
-
2partner_financial_risk/models/__init__.py
-
2partner_financial_risk/models/account_invoice.py
-
2partner_financial_risk/models/res_company.py
-
2partner_financial_risk/models/res_config.py
-
20partner_financial_risk/models/res_partner.py
-
2partner_financial_risk/tests/__init__.py
-
18partner_financial_risk/tests/test_partner_financial_risk.py
-
28partner_financial_risk/views/account_invoice_view.xml
-
38partner_financial_risk/views/res_config_view.xml
-
106partner_financial_risk/views/res_partner_view.xml
-
2partner_financial_risk/wizard/__init__.py
-
2partner_financial_risk/wizard/parner_risk_exceeded.py
-
58partner_financial_risk/wizard/partner_risk_exceeded_view.xml
@ -1,4 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import models |
|||
from . import wizard |
@ -1,15 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
|||
<odoo> |
|||
<record id="ir_cron_due_invoice_every_day" model="ir.cron"> |
|||
<field name="name">Financial risk: Process due invoices</field> |
|||
<field name="interval_number">1</field> |
|||
<field name="interval_type">days</field> |
|||
<field name="numbercall">-1</field> |
|||
<field name="doall" eval="False"/> |
|||
<field name="model" eval="'res.partner'"/> |
|||
<field name="function" eval="'process_unpaid_invoices'"/> |
|||
<field name="args" eval="'()'"/> |
|||
</record> |
|||
</odoo> |
|||
<openerp> |
|||
<data> |
|||
<record id="ir_cron_due_invoice_every_day" model="ir.cron"> |
|||
<field name="name">Financial risk: Process due invoices</field> |
|||
<field name="interval_number">1</field> |
|||
<field name="interval_type">days</field> |
|||
<field name="numbercall">-1</field> |
|||
<field name="doall" eval="False"/> |
|||
<field name="model" eval="'res.partner'"/> |
|||
<field name="function" eval="'process_unpaid_invoices'"/> |
|||
<field name="args" eval="'()'"/> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,3 +1,5 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import test_partner_financial_risk |
@ -1,15 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
|||
<odoo> |
|||
<record id="invoice_partner_risk_form" model="ir.ui.view"> |
|||
<field name="name">account.invoice.partner.risk.form</field> |
|||
<field name="model">account.invoice</field> |
|||
<field name="inherit_id" ref="account.invoice_form"/> |
|||
<field name="arch" type="xml"> |
|||
<button name="invoice_open" position="attributes"> |
|||
<attribute name="type">object</attribute> |
|||
</button> |
|||
</field> |
|||
</record> |
|||
</odoo> |
|||
<openerp> |
|||
<data> |
|||
<record id="invoice_partner_risk_form" model="ir.ui.view"> |
|||
<field name="name">account.invoice.partner.risk.form</field> |
|||
<field name="model">account.invoice</field> |
|||
<field name="inherit_id" ref="account.invoice_form"/> |
|||
<field name="arch" type="xml"> |
|||
<button name="invoice_open" position="attributes"> |
|||
<attribute name="type">object</attribute> |
|||
</button> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,21 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
|||
<odoo> |
|||
|
|||
<record id="view_account_config" model="ir.ui.view"> |
|||
<field name="name">account settings</field> |
|||
<field name="model">account.config.settings</field> |
|||
<field name="inherit_id" ref="account.view_account_config_settings"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@name='payment_acquirer']/.." position="after"> |
|||
<label for="id" string="Financial Risk"/> |
|||
<div name="financial_risk" string="Financial Risk div"> |
|||
<label for="invoice_unpaid_margin"/> |
|||
<field name="invoice_unpaid_margin" class="oe_inline"/> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
|||
<openerp> |
|||
<data> |
|||
<record id="view_account_config" model="ir.ui.view"> |
|||
<field name="name">account settings</field> |
|||
<field name="model">account.config.settings</field> |
|||
<field name="inherit_id" ref="account.view_account_config_settings"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@name='payment_acquirer']/.." position="after"> |
|||
<label for="id" string="Financial Risk"/> |
|||
<div name="financial_risk" string="Financial Risk div"> |
|||
<label for="invoice_unpaid_margin"/> |
|||
<field name="invoice_unpaid_margin" class="oe_inline"/> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,58 +1,60 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
|||
<odoo> |
|||
<record id="res_partner_view_risk" model="ir.ui.view"> |
|||
<field name="name">res.partner.view.risk</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="priority" eval="20"/> |
|||
<field name="groups_id" eval="[(4, ref('base.group_sale_salesman')), (4, ref('account.group_account_manager'))]"/> |
|||
<field name="arch" type="xml"> |
|||
<page name="sales_purchases" position="after"> |
|||
<page name="financial_risk" string="Financial Risk" attrs="{'invisible': [('customer','=',False)]}"> |
|||
<group name="risk_general" col="3"> |
|||
<group string="General Limits" name="risk_include" col="1" colspan="2"> |
|||
<group col="3" class="oe_subtotal_footer"> |
|||
<field name="risk_invoice_draft_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_draft" nolabel="1"/> |
|||
<field name="risk_invoice_open_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_open" nolabel="1"/> |
|||
<field name="risk_invoice_unpaid_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_unpaid" nolabel="1"/> |
|||
<field name="risk_account_amount_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_account_amount" nolabel="1"/> |
|||
<field name="risk_total" colspan="3" class="oe_subtotal_footer_separator"/> |
|||
</group> |
|||
</group> |
|||
<group string="Specific Limits" name="risk_limits" col="1"> |
|||
<group class="oe_subtotal_footer"> |
|||
<field name="risk_invoice_draft_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_open_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_unpaid_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_account_amount_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_allow_edit" invisible="1"/> |
|||
</group> |
|||
<openerp> |
|||
<data> |
|||
<record id="res_partner_view_risk" model="ir.ui.view"> |
|||
<field name="name">res.partner.view.risk</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="priority" eval="20"/> |
|||
<field name="groups_id" eval="[(4, ref('base.group_sale_salesman')), (4, ref('account.group_account_manager'))]"/> |
|||
<field name="arch" type="xml"> |
|||
<page name="sales_purchases" position="after"> |
|||
<page name="financial_risk" string="Financial Risk" attrs="{'invisible': [('customer','=',False)]}"> |
|||
<group name="risk_general" col="3"> |
|||
<group string="General Limits" name="risk_include" col="1" colspan="2"> |
|||
<group col="3" class="oe_subtotal_footer"> |
|||
<field name="risk_invoice_draft_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_draft" nolabel="1"/> |
|||
<field name="risk_invoice_open_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_open" nolabel="1"/> |
|||
<field name="risk_invoice_unpaid_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_unpaid" nolabel="1"/> |
|||
<field name="risk_account_amount_include" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_account_amount" nolabel="1"/> |
|||
<field name="risk_total" colspan="3" class="oe_subtotal_footer_separator"/> |
|||
</group> |
|||
</group> |
|||
<group string="Info" col="4"> |
|||
<field name="credit_limit" |
|||
widget="monetary" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="credit_policy" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_exception"/> |
|||
<group string="Specific Limits" name="risk_limits" col="1"> |
|||
<group class="oe_subtotal_footer"> |
|||
<field name="risk_invoice_draft_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_open_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_invoice_unpaid_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_account_amount_limit" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_allow_edit" invisible="1"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</group> |
|||
<group string="Info" col="4"> |
|||
<field name="credit_limit" |
|||
widget="monetary" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="credit_policy" |
|||
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"/> |
|||
<field name="risk_exception"/> |
|||
</group> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
</odoo> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,3 +1,5 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import parner_risk_exceeded |
@ -1,30 +1,32 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
|||
<odoo> |
|||
<record id="partner_risk_exceeded_wizard" model="ir.ui.view"> |
|||
<field name="name">Partner risk exceeded</field> |
|||
<field name="model">partner.risk.exceeded.wiz</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Risk exceeded"> |
|||
<p>The partner has exceeded his risk</p> |
|||
<field name="exception_msg" colspan="2" nolabel="1"/> |
|||
<group> |
|||
<field name="partner_id"/> |
|||
</group> |
|||
<footer> |
|||
<button string="Continue" |
|||
class="oe_highlight" |
|||
name="button_continue" |
|||
type="object" |
|||
groups="base.group_sale_manager,account.group_account_manager" |
|||
/> |
|||
<button string="Cancel" |
|||
class="oe_link" |
|||
special="cancel" |
|||
/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</odoo> |
|||
<openerp> |
|||
<data> |
|||
<record id="partner_risk_exceeded_wizard" model="ir.ui.view"> |
|||
<field name="name">Partner risk exceeded</field> |
|||
<field name="model">partner.risk.exceeded.wiz</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Risk exceeded"> |
|||
<p>The partner has exceeded his risk</p> |
|||
<field name="exception_msg" colspan="2" nolabel="1"/> |
|||
<group> |
|||
<field name="partner_id"/> |
|||
</group> |
|||
<footer> |
|||
<button string="Continue" |
|||
class="oe_highlight" |
|||
name="button_continue" |
|||
type="object" |
|||
groups="base.group_sale_manager,account.group_account_manager" |
|||
/> |
|||
<button string="Cancel" |
|||
class="oe_link" |
|||
special="cancel" |
|||
/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue