-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4085c38
commit 6735a8b
Showing
76 changed files
with
8,972 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
=================== | ||
Sale Financial Risk | ||
=================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:ea8927c83b428d46a09ec5731ed39bf3def893cc64a8904cc994621051da9e8b | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcredit--control-lightgray.png?logo=github | ||
:target: https://github.com/OCA/credit-control/tree/16.0/sale_financial_risk | ||
:alt: OCA/credit-control | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/credit-control&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Extends Partner Financial Risk to manage sales orders. | ||
|
||
Adds a new risk amount field in sale order line to compute risk based on the | ||
difference between ordered quantity (or delivered in some cases) and invoiced | ||
quantity. | ||
|
||
If any limit is exceed the partner gets forbidden to confirm sale orders. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to *Customers > Financial Risk* | ||
#. Set limits and choose options to compute in credit limit. | ||
#. Go to *Sales -> Orders -> Orders* and create a new Sales Orders. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/credit-control/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/credit-control/issues/new?body=module:%20sale_financial_risk%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Tecnativa <https://www.tecnativa.com>`_: | ||
|
||
* Carlos Dauden | ||
* Pedro M. Baeza | ||
* Ernesto Tejeda | ||
* Stefan Ungureanu | ||
|
||
* Agathe Mollé <agathe.molle@savoirfairelinux.com> | ||
|
||
* Ugne Sinkeviciene <ugne@versada.eu> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/credit-control <https://github.com/OCA/credit-control/tree/16.0/sale_financial_risk>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .hooks import pre_init_hook | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2016-2020 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Sale Financial Risk", | ||
"summary": "Manage partner risk in sales orders", | ||
"version": "16.0.1.1.2", | ||
"category": "Sales Management", | ||
"license": "AGPL-3", | ||
"author": "Tecnativa, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/credit-control", | ||
"depends": ["sale", "account_financial_risk"], | ||
"data": [ | ||
"views/res_partner_view.xml", | ||
"views/sale_financial_risk_view.xml", | ||
"views/res_config_settings.xml", | ||
], | ||
"installable": True, | ||
"pre_init_hook": "pre_init_hook", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2020 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
import logging | ||
|
||
from odoo.tools import sql | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def pre_init_hook(cr): | ||
""" | ||
The objective of this hook is to speed up the installation | ||
of the module on an existing Odoo instance. | ||
""" | ||
create_risk_partner_id_column(cr) | ||
|
||
|
||
def create_risk_partner_id_column(cr): | ||
if not sql.column_exists(cr, "sale_order_line", "risk_partner_id"): | ||
sql.create_column(cr, "sale_order_line", "risk_partner_id", "int4") | ||
|
||
logger.info("Computing field risk_partner_id on sale.order.line") | ||
cr.execute( | ||
""" | ||
UPDATE sale_order_line sol | ||
SET risk_partner_id = p.commercial_partner_id | ||
FROM sale_order so LEFT JOIN | ||
res_partner p ON p.id = so.partner_invoice_id | ||
WHERE so.id = sol.order_id and | ||
sol.risk_partner_id IS DISTINCT FROM p.commercial_partner_id; | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_financial_risk | ||
# | ||
# Translators: | ||
# OCA Transbot <transbot@odoo-community.org>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 9.0c\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-06-02 00:47+0000\n" | ||
"PO-Revision-Date: 2017-06-02 00:47+0000\n" | ||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" | ||
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n" | ||
"Language: am\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_sale_order_line__risk_partner_id | ||
msgid "Commercial Entity" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_sale_order_line__company_currency_id | ||
msgid "Company Currency" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model,name:sale_financial_risk.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model,name:sale_financial_risk.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#. odoo-python | ||
#: code:addons/sale_financial_risk/models/sale.py:0 | ||
#, python-format | ||
msgid "Financial risk exceeded.\n" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_partner__risk_sale_order_include | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_users__risk_sale_order_include | ||
msgid "Full risk computation" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_partner__risk_sale_order_include | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_users__risk_sale_order_include | ||
msgid "Include Sales Orders" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_config_settings__include_risk_sale_order_done | ||
#: model_terms:ir.ui.view,arch_db:sale_financial_risk.res_config_settings_view_form | ||
msgid "Include locked sale orders into risk calculation" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model_terms:ir.ui.view,arch_db:sale_financial_risk.res_config_settings_view_form | ||
msgid "Include orders in done state" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_sale_order__partner_invoice_id | ||
msgid "Invoice Address" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_partner__risk_sale_order_limit | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_users__risk_sale_order_limit | ||
msgid "Limit Sales Orders" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model,name:sale_financial_risk.model_payment_transaction | ||
msgid "Payment Transaction" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_sale_order_line__risk_amount | ||
msgid "Risk Amount" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model_terms:ir.ui.view,arch_db:sale_financial_risk.financial_risk_sale_order_line_pivot_view | ||
msgid "Sale lines" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model,name:sale_financial_risk.model_sale_order | ||
msgid "Sales Order" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model,name:sale_financial_risk.model_sale_order_line | ||
msgid "Sales Order Line" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_partner__risk_sale_order_limit | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_users__risk_sale_order_limit | ||
msgid "Set 0 if it is not locked" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#. odoo-python | ||
#: code:addons/sale_financial_risk/models/sale.py:0 | ||
#, python-format | ||
msgid "This sale order exceeds the financial risk.\n" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#. odoo-python | ||
#: code:addons/sale_financial_risk/models/sale.py:0 | ||
#, python-format | ||
msgid "This sale order exceeds the sales orders risk.\n" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_partner__risk_sale_order | ||
#: model:ir.model.fields,field_description:sale_financial_risk.field_res_users__risk_sale_order | ||
msgid "Total Sales Orders Not Invoiced" | ||
msgstr "" | ||
|
||
#. module: sale_financial_risk | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_partner__risk_sale_order | ||
#: model:ir.model.fields,help:sale_financial_risk.field_res_users__risk_sale_order | ||
msgid "Total not invoiced of sales orders in Sale Order state" | ||
msgstr "" | ||
|
||
#~ msgid "Partner" | ||
#~ msgstr "ተባባሪ" |
Oops, something went wrong.