Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] sale_financial_risk #377

Merged
merged 62 commits into from
Jun 18, 2024
Merged
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
e4c8649
[9.0][ADD] partner_sale_risk: New module
carlosdauden Oct 24, 2016
42d3af8
[MIG] Partner Sale Risk : Migration to 10.0
Ehtaga Jul 25, 2017
8b5eab6
[MIG] partner_sale_risk: Migration to 11.0
carlosdauden May 8, 2018
95d1515
[REN] partner_sale_risk > sale_financial_risk
carlosdauden May 8, 2018
3ff4587
[IMP] sale_financial_risk: Use new core fields amt_to_invoice and amt…
carlosdauden Jun 21, 2018
fa18bd6
[IMP] sale_financial_risk: Improve layout view. Readme new template
carlosdauden Jun 21, 2018
1b464b3
[IMP] sale_financial_risk: Rename module in translations files
carlosdauden Jun 21, 2018
286ef82
[MIG] sale_financial_risk: Migration to 12.0
ernestotejeda Feb 22, 2019
c7e8828
[MIG] sale_financial_risk: Add unit tests
ernestotejeda Mar 11, 2019
89da593
[IMP] sale_financial_risk: Simplify code (Remove no directly related …
carlosdauden Mar 12, 2019
f25555d
Translated using Weblate (French)
chafique-delli Jul 23, 2019
240c970
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
ac8bd80
Translated using Weblate (Italian)
MarcoCalcagni Oct 19, 2019
a2e2e2b
[IMP] sale_financial_risk: Fix test crash with other modules due to p…
sergio-teruel Nov 14, 2019
81963ce
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 20, 2020
7d7093e
Translated using Weblate (Portuguese)
pedrocasi Feb 29, 2020
3868187
[IMP] sale_financial_risk: Bypass risk when payment transaction is au…
carlosdauden Apr 23, 2020
6d2ec67
[IMP] account_financial_risk account_payment_return_financial_risk sa…
carlosdauden May 26, 2020
d45bb44
[IMP] sale_financial_risk: black, isort, prettier
MiquelRForgeFlow Jun 15, 2020
e20e746
[MIG] sale_financial_risk: Migration to 13.0
MiquelRForgeFlow Jun 15, 2020
6213703
Translated using Weblate (French)
leemannd Aug 25, 2020
dd59d75
[IMP] Add selection: choose which currency should be used in risk
MiquelRForgeFlow Jun 16, 2020
813af7a
[IMP] sale_financial_risk: Compute risk for partner invoice. Add inhe…
sergio-teruel Sep 22, 2020
3184c29
[IMP] sale_financial_risk: Change related risk partner target and ren…
carlosdauden Oct 15, 2020
0a3496a
[MIG] sale_financial_risk: Migration to 14.0
psugne Nov 27, 2020
2653077
Translated using Weblate (French)
Yvesldff Mar 24, 2021
6e24734
Translated using Weblate (Dutch)
bosd Apr 23, 2021
1331ea9
[FIX] sale_financial_risk: Commercial partner not set when value is null
carlosdauden Jul 21, 2021
c0c3b9e
[FIX] sale_financial_risk: Don't use deprecated method
Jul 29, 2021
e0e89b7
[IMP] sale_financial_risk: black, isort, prettier
JoanMForgeFlow Nov 9, 2021
3c261f0
[15.0][MIG] sale_financial_risk: Migration to 15.0
JoanMForgeFlow Nov 9, 2021
18e50ae
[FIX] account_financial_risk: consider include in risk_exception
MiquelRForgeFlow Nov 30, 2021
7ec87ad
[FIX] sale_financial_risk: Expected singleton: sale.order()
Dec 11, 2020
c01287a
[FIX] sale_financial_risk: Make tests to work
pedrobaeza Mar 7, 2022
46ff1ff
[IMP]sale_financial_risk: Add sale orders in done state to risk calcu…
jesusVMayor Jul 8, 2020
6f17c8e
Translated using Weblate (French)
ClementChaumienneC2C Jul 5, 2022
d962676
Translated using Weblate (Italian)
francesco-ooops Feb 1, 2023
7227ffe
[MIG] sale_financial_risk: Migration to 16.0
stefan-tecnativa Apr 25, 2023
c695fc6
[UPD] Update sale_financial_risk.pot
Jul 19, 2023
4830698
[UPD] README.rst
OCA-git-bot Jul 19, 2023
bbae79c
Update translation files
weblate Jul 19, 2023
b940b4f
Update translation files
weblate Jul 19, 2023
82f4f8f
Translated using Weblate (Spanish)
Ivorra78 Jul 21, 2023
bb2664e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
2bd1f39
[FIX] sale_financial_risk: call the right methods
chienandalu Sep 12, 2023
bb96d8e
[IMP] sale_financial_risk: credit_limit change performance
chienandalu Jun 14, 2023
bae315f
[UPD] Update sale_financial_risk.pot
Sep 14, 2023
be17fc6
sale_financial_risk 16.0.1.0.1
OCA-git-bot Sep 14, 2023
70a4117
[UPD] README.rst
OCA-git-bot Sep 14, 2023
3d4b13a
Update translation files
weblate Sep 20, 2023
5f013f6
Translated using Weblate (Spanish)
Ivorra78 Sep 24, 2023
edbd389
[IMP] account_financial_risk: Change risk tab group to new for more f…
carlosdauden Jul 23, 2021
862a46f
[BOT] post-merge updates
OCA-git-bot Oct 10, 2023
08c7bf9
[IMP] sale_financial_risk: test performance improvement
josep-tecnativa Oct 17, 2023
9b10f5a
[BOT] post-merge updates
OCA-git-bot Oct 20, 2023
3b33117
Translated using Weblate (Spanish)
Ivorra78 Oct 22, 2023
82ae8e3
[FIX] When evaluating risk, convert the amount to correct currency
maciej-wichowski Sep 18, 2023
7963cb8
[FIX] sale_financial_risk: fix test
pilarvargas-tecnativa Feb 22, 2024
75b2227
[BOT] post-merge updates
OCA-git-bot Mar 23, 2024
28a249d
Translated using Weblate (Dutch)
ThijsvOers Apr 2, 2024
35e7fe3
[IMP] sale_financial_risk: pre-commit auto fixes
sbiosca-s73 Jun 18, 2024
0c79ab7
[17.0][MIG] sale_financial_risk: Migration to 17.0
sbiosca-s73 Jun 18, 2024
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
100 changes: 100 additions & 0 deletions sale_financial_risk/README.rst
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/17.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-17-0/credit-control-17-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=17.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:%2017.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/17.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": "17.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