Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6a39b68
[9.0][ADD] partner_sale_risk: New module
carlosdauden Oct 24, 2016
244a1e6
[MIG] Partner Sale Risk : Migration to 10.0
Ehtaga Jul 25, 2017
547e7e5
[MIG] partner_sale_risk: Migration to 11.0
carlosdauden May 8, 2018
0b584be
[REN] partner_sale_risk > sale_financial_risk
carlosdauden May 8, 2018
20b0f9f
[IMP] sale_financial_risk: Use new core fields amt_to_invoice and amt…
carlosdauden Jun 21, 2018
e5dc036
[IMP] sale_financial_risk: Improve layout view. Readme new template
carlosdauden Jun 21, 2018
4e93cc7
[IMP] sale_financial_risk: Rename module in translations files
carlosdauden Jun 21, 2018
f448fb3
[MIG] sale_financial_risk: Migration to 12.0
ernestotejeda Feb 22, 2019
874ada2
[MIG] sale_financial_risk: Add unit tests
ernestotejeda Mar 11, 2019
f4b9dc9
[IMP] sale_financial_risk: Simplify code (Remove no directly related …
carlosdauden Mar 12, 2019
c334cd9
Translated using Weblate (French)
chafique-delli Jul 23, 2019
48de137
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
c326599
Translated using Weblate (Italian)
Oct 19, 2019
a4b1c92
[IMP] sale_financial_risk: Fix test crash with other modules due to p…
sergio-teruel Nov 14, 2019
efc9c1d
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 20, 2020
d1dbbe2
Translated using Weblate (Portuguese)
pedrocs-exo Feb 29, 2020
55dad98
[IMP] sale_financial_risk: Bypass risk when payment transaction is au…
carlosdauden Apr 23, 2020
7b309ef
[IMP] account_financial_risk account_payment_return_financial_risk sa…
carlosdauden May 26, 2020
2abafa3
[IMP] sale_financial_risk: black, isort, prettier
MiquelRForgeFlow Jun 15, 2020
1ff9b7c
[MIG] sale_financial_risk: Migration to 13.0
MiquelRForgeFlow Jun 15, 2020
d09bee8
Translated using Weblate (French)
leemannd Aug 25, 2020
daa2ba8
[IMP] Add selection: choose which currency should be used in risk
MiquelRForgeFlow Jun 16, 2020
65b9957
[IMP] sale_financial_risk: Compute risk for partner invoice. Add inhe…
sergio-teruel Sep 22, 2020
e1b8eb0
[IMP] sale_financial_risk: Change related risk partner target and ren…
carlosdauden Oct 15, 2020
9116138
[MIG] sale_financial_risk: Migration to 14.0
psugne Nov 27, 2020
d7e833f
Translated using Weblate (French)
Yvesldff Mar 24, 2021
ff904f0
Translated using Weblate (Dutch)
bosd Apr 23, 2021
491bd06
[FIX] sale_financial_risk: Commercial partner not set when value is null
carlosdauden Jul 21, 2021
6848bb2
[FIX] sale_financial_risk: Don't use deprecated method
Jul 29, 2021
d51c443
[IMP] sale_financial_risk: black, isort, prettier
JoanMForgeFlow Nov 9, 2021
10dca31
[15.0][MIG] sale_financial_risk: Migration to 15.0
JoanMForgeFlow Nov 9, 2021
78defc4
[FIX] account_financial_risk: consider include in risk_exception
MiquelRForgeFlow Nov 30, 2021
cac748c
[FIX] sale_financial_risk: Expected singleton: sale.order()
Dec 11, 2020
f942dd9
[FIX] sale_financial_risk: Make tests to work
pedrobaeza Mar 7, 2022
916813d
[IMP]sale_financial_risk: Add sale orders in done state to risk calcu…
jesusVMayor Jul 8, 2020
ac600f1
Translated using Weblate (French)
ClementChaumienneC2C Jul 5, 2022
771cf6d
Translated using Weblate (Italian)
francesco-ooops Feb 1, 2023
90817b6
[MIG] sale_financial_risk: Migration to 16.0
stefan-tecnativa Apr 25, 2023
cfb5b13
Translated using Weblate (Spanish)
Ivorra78 Jul 21, 2023
10b144f
[FIX] sale_financial_risk: call the right methods
chienandalu Sep 12, 2023
611f924
[IMP] sale_financial_risk: credit_limit change performance
chienandalu Jun 14, 2023
d6186fb
Translated using Weblate (Spanish)
Ivorra78 Sep 24, 2023
6b92054
[IMP] account_financial_risk: Change risk tab group to new for more f…
carlosdauden Jul 23, 2021
57e2507
[IMP] sale_financial_risk: test performance improvement
josep-tecnativa Oct 17, 2023
dc4cd26
Translated using Weblate (Spanish)
Ivorra78 Oct 22, 2023
677b074
[FIX] When evaluating risk, convert the amount to correct currency
maciej-wichowski Sep 18, 2023
0511fd9
[FIX] sale_financial_risk: fix test
pilarvargas-tecnativa Feb 22, 2024
fab0987
Translated using Weblate (Dutch)
ThijsvOers Apr 2, 2024
5ab72f7
[IMP] sale_financial_risk: pre-commit auto fixes
sbiosca-s73 Jun 18, 2024
68b448a
[17.0][MIG] sale_financial_risk: Migration to 17.0
sbiosca-s73 Jun 18, 2024
7535ce3
Translated using Weblate (Italian)
mymage Jul 8, 2024
9dbb7a0
[FIX] sale_financial_risk: Avoid test error when comparing expected t…
carlos-lopez-tecnativa Sep 2, 2024
61ec113
[IMP] sale_financial_risk: New option to allow overrisk sale confirma…
carlosdauden Feb 25, 2025
87eda6b
[MIG] sale_financial_risk: Migration to 18.0
Dec 8, 2024
a9787e2
[FIX] sale_financial_risk: rounding where uom is missing (eg. down pa…
AaronHForgeFlow May 5, 2025
4eb8040
Translated using Weblate (Turkish)
bo-eska May 8, 2025
587d914
[FIX] sale_financial_risk: Salesman user only compute your own orders
carlosdauden Jan 8, 2025
07a3eef
[FIX] sale_financial_risk: better format res_partner_view
Apr 22, 2025
d6a1e19
[FIX] sale_financial_risk: Use the assert_called_once() method to avo…
victoralmau Jul 31, 2025
d86d851
[18.0][FIX] Fix access error on partner.credit_limit
tobiaszehntner Jul 22, 2025
3a1bd4c
[IMP] sale_financial_risk: Extend _get_financial_risk_lines to includ…
pilarvargas-tecnativa Aug 18, 2025
1d19c31
[MIG] sale_financial_risk: Migration to 19.0
pablo-cort-s73 Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions sale_financial_risk/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Sale Financial Risk
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e01c8b7e6ffe45c71c56e0b59574a8cfb43644087f75958793cd0a2244e82fac
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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/19.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-19-0/credit-control-19-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=19.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:

1. Go to *Customers > Financial Risk*
2. Set limits and choose options to compute in credit limit.
3. 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:%2019.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>
- `Studio73 <https://www.studio73.es/>`__:

- Pablo Cortés

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/19.0/sale_financial_risk>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_financial_risk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .hooks import pre_init_hook
from . import models
20 changes: 20 additions & 0 deletions sale_financial_risk/__manifest__.py
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": "19.0.1.0.0",
"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",
}
32 changes: 32 additions & 0 deletions sale_financial_risk/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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(env):
"""
The objective of this hook is to speed up the installation
of the module on an existing Odoo instance.
"""
create_risk_partner_id_column(env)


def create_risk_partner_id_column(env):
if not sql.column_exists(env.cr, "sale_order_line", "risk_partner_id"):
sql.create_column(env.cr, "sale_order_line", "risk_partner_id", "int4")
logger.info("Computing field risk_partner_id on sale.order.line")
env.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;
"""
)
140 changes: 140 additions & 0 deletions sale_financial_risk/i18n/am.po
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 "ተባባሪ"
Loading
Loading