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

18.0 mig sale financial risk #408

Open
wants to merge 60 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b1aca34
[9.0][ADD] partner_sale_risk: New module
carlosdauden Oct 24, 2016
cb1be52
[MIG] Partner Sale Risk : Migration to 10.0
Ehtaga Jul 25, 2017
49bcdc7
[MIG] partner_sale_risk: Migration to 11.0
carlosdauden May 8, 2018
7badedb
[REN] partner_sale_risk > sale_financial_risk
carlosdauden May 8, 2018
4a75768
[IMP] sale_financial_risk: Use new core fields amt_to_invoice and amt…
carlosdauden Jun 21, 2018
24faf0b
[IMP] sale_financial_risk: Improve layout view. Readme new template
carlosdauden Jun 21, 2018
900d546
[IMP] sale_financial_risk: Rename module in translations files
carlosdauden Jun 21, 2018
6b80697
[MIG] sale_financial_risk: Migration to 12.0
ernestotejeda Feb 22, 2019
414b830
[MIG] sale_financial_risk: Add unit tests
ernestotejeda Mar 11, 2019
2877fd5
[IMP] sale_financial_risk: Simplify code (Remove no directly related …
carlosdauden Mar 12, 2019
fd3f270
Translated using Weblate (French)
chafique-delli Jul 23, 2019
b03abdc
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
e8db43a
Translated using Weblate (Italian)
MarcoCalcagni Oct 19, 2019
866744c
[IMP] sale_financial_risk: Fix test crash with other modules due to p…
sergio-teruel Nov 14, 2019
25c9c6f
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 20, 2020
9fd247a
Translated using Weblate (Portuguese)
pedrocs-exo Feb 29, 2020
d5b4d16
[IMP] sale_financial_risk: Bypass risk when payment transaction is au…
carlosdauden Apr 23, 2020
61f7404
[IMP] account_financial_risk account_payment_return_financial_risk sa…
carlosdauden May 26, 2020
0f9d3ee
[IMP] sale_financial_risk: black, isort, prettier
MiquelRForgeFlow Jun 15, 2020
6c98fae
[MIG] sale_financial_risk: Migration to 13.0
MiquelRForgeFlow Jun 15, 2020
cf93041
Translated using Weblate (French)
leemannd Aug 25, 2020
afc684b
[IMP] Add selection: choose which currency should be used in risk
MiquelRForgeFlow Jun 16, 2020
1502f27
[IMP] sale_financial_risk: Compute risk for partner invoice. Add inhe…
sergio-teruel Sep 22, 2020
daaee4a
[IMP] sale_financial_risk: Change related risk partner target and ren…
carlosdauden Oct 15, 2020
68749a1
[MIG] sale_financial_risk: Migration to 14.0
psugne Nov 27, 2020
b291526
Translated using Weblate (French)
Yvesldff Mar 24, 2021
3e53ea1
Translated using Weblate (Dutch)
bosd Apr 23, 2021
7eb3378
[FIX] sale_financial_risk: Commercial partner not set when value is null
carlosdauden Jul 21, 2021
a038bc2
[FIX] sale_financial_risk: Don't use deprecated method
Jul 29, 2021
4107e14
[IMP] sale_financial_risk: black, isort, prettier
JoanMForgeFlow Nov 9, 2021
299eb30
[15.0][MIG] sale_financial_risk: Migration to 15.0
JoanMForgeFlow Nov 9, 2021
028cd39
[FIX] account_financial_risk: consider include in risk_exception
MiquelRForgeFlow Nov 30, 2021
b936e0e
[FIX] sale_financial_risk: Expected singleton: sale.order()
Dec 11, 2020
d3e080e
[FIX] sale_financial_risk: Make tests to work
pedrobaeza Mar 7, 2022
2085141
[IMP]sale_financial_risk: Add sale orders in done state to risk calcu…
jesusVMayor Jul 8, 2020
c658b3f
Translated using Weblate (French)
ClementChaumienneC2C Jul 5, 2022
fc6e4e8
Translated using Weblate (Italian)
francesco-ooops Feb 1, 2023
2b807e0
[MIG] sale_financial_risk: Migration to 16.0
stefan-tecnativa Apr 25, 2023
a4abb5d
[UPD] Update sale_financial_risk.pot
Jul 19, 2023
eaf5c17
Update translation files
weblate Jul 19, 2023
20b0d94
Translated using Weblate (Spanish)
Ivorra78 Jul 21, 2023
e226dd5
[FIX] sale_financial_risk: call the right methods
chienandalu Sep 12, 2023
4a9f845
[IMP] sale_financial_risk: credit_limit change performance
chienandalu Jun 14, 2023
c37a16e
[UPD] Update sale_financial_risk.pot
Sep 14, 2023
1a9291d
Update translation files
weblate Sep 20, 2023
22e9de9
Translated using Weblate (Spanish)
Ivorra78 Sep 24, 2023
10498d0
[IMP] account_financial_risk: Change risk tab group to new for more f…
carlosdauden Jul 23, 2021
e40fd2d
[IMP] sale_financial_risk: test performance improvement
josep-tecnativa Oct 17, 2023
edd052c
Translated using Weblate (Spanish)
Ivorra78 Oct 22, 2023
b92c93d
[FIX] When evaluating risk, convert the amount to correct currency
maciej-wichowski Sep 18, 2023
5802797
[FIX] sale_financial_risk: fix test
pilarvargas-tecnativa Feb 22, 2024
74d4eeb
Translated using Weblate (Dutch)
ThijsvOers Apr 2, 2024
7b5e6f1
[IMP] sale_financial_risk: pre-commit auto fixes
sbiosca-s73 Jun 18, 2024
ce3a2ad
[17.0][MIG] sale_financial_risk: Migration to 17.0
sbiosca-s73 Jun 18, 2024
89e6f79
[UPD] Update sale_financial_risk.pot
Jun 18, 2024
c70f7ef
Update translation files
weblate Jul 7, 2024
0618097
Translated using Weblate (Italian)
mymage Jul 8, 2024
25b2daa
[FIX] sale_financial_risk: Avoid test error when comparing expected t…
carlos-lopez-tecnativa Sep 2, 2024
93aa849
[IMP] sale_financial_risk: pre-commit auto fixes
Dec 8, 2024
7f379d4
[DON'T MERGE] test-requirements.txt
Dec 10, 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:f792f6579ca7a09924a016844c4e4a7b72e46015e124eb7c084c8ad8b0890485
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.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-18-0/credit-control-18-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=18.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:%2018.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é <[email protected]>
- Ugne Sinkeviciene <[email protected]>

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/18.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": "18.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 <[email protected]>, 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 <[email protected]>, 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