Skip to content

Commit b4e69ea

Browse files
[MIG] sale_financial_risk: Migration to 19.0
1 parent d65d773 commit b4e69ea

File tree

6 files changed

+48
-26
lines changed

6 files changed

+48
-26
lines changed

sale_financial_risk/README.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Sale Financial Risk
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcredit--control-lightgray.png?logo=github
24-
:target: https://github.com/OCA/credit-control/tree/18.0/sale_financial_risk
24+
:target: https://github.com/OCA/credit-control/tree/19.0/sale_financial_risk
2525
:alt: OCA/credit-control
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/credit-control-18-0/credit-control-18-0-sale_financial_risk
27+
:target: https://translation.odoo-community.org/projects/credit-control-19-0/credit-control-19-0-sale_financial_risk
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/credit-control&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/credit-control&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -61,7 +61,7 @@ Bug Tracker
6161
Bugs are tracked on `GitHub Issues <https://github.com/OCA/credit-control/issues>`_.
6262
In case of trouble, please check there if your issue has already been reported.
6363
If you spotted it first, help us to smash it by providing a detailed and welcomed
64-
`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**>`_.
64+
`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**>`_.
6565

6666
Do not contact contributors directly about support or help with technical issues.
6767

@@ -76,15 +76,18 @@ Authors
7676
Contributors
7777
------------
7878

79-
- `Tecnativa <https://www.tecnativa.com>`__:
79+
- `Tecnativa <https://www.tecnativa.com>`__:
8080

81-
- Carlos Dauden
82-
- Pedro M. Baeza
83-
- Ernesto Tejeda
84-
- Stefan Ungureanu
81+
- Carlos Dauden
82+
- Pedro M. Baeza
83+
- Ernesto Tejeda
84+
- Stefan Ungureanu
8585

86-
- Agathe Mollé <agathe.molle@savoirfairelinux.com>
87-
- Ugne Sinkeviciene <ugne@versada.eu>
86+
- Agathe Mollé <agathe.molle@savoirfairelinux.com>
87+
- Ugne Sinkeviciene <ugne@versada.eu>
88+
- `Studio73 <https://www.studio73.es/>`__:
89+
90+
- Pablo Cortés
8891

8992
Maintainers
9093
-----------
@@ -99,6 +102,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
99102
mission is to support the collaborative development of Odoo features and
100103
promote its widespread use.
101104

102-
This module is part of the `OCA/credit-control <https://github.com/OCA/credit-control/tree/18.0/sale_financial_risk>`_ project on GitHub.
105+
This module is part of the `OCA/credit-control <https://github.com/OCA/credit-control/tree/19.0/sale_financial_risk>`_ project on GitHub.
103106

104107
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sale_financial_risk/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Sale Financial Risk",
66
"summary": "Manage partner risk in sales orders",
7-
"version": "18.0.1.0.6",
7+
"version": "19.0.1.0.0",
88
"category": "Sales Management",
99
"license": "AGPL-3",
1010
"author": "Tecnativa, Odoo Community Association (OCA)",

sale_financial_risk/models/payment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
class PaymentTransaction(models.Model):
88
_inherit = "payment.transaction"
99

10-
def _set_authorized(self):
10+
def _set_authorized(self, **kwargs):
1111
"""Bypass risk for sale confirmation triggered by this method"""
1212
return super(
1313
PaymentTransaction, self.with_context(bypass_risk=True)
14-
)._set_authorized()
14+
)._set_authorized(**kwargs)
1515

1616
def _post_process(self):
1717
"""Bypass risk for sale confirmation and invoice creation triggered

sale_financial_risk/models/res_partner.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

44
from odoo import api, fields, models
5+
from odoo.fields import Domain
56

67

78
class ResPartner(models.Model):
@@ -25,10 +26,15 @@ class ResPartner(models.Model):
2526

2627
def _get_risk_sale_order_domain(self):
2728
risk_states = self.env["sale.order"]._get_risk_states()
28-
return self._get_risk_company_domain() + [
29-
("state", "in", risk_states),
30-
("risk_partner_id", "in", self.mapped("commercial_partner_id").ids),
31-
]
29+
return Domain.AND(
30+
self._get_risk_company_domain(),
31+
Domain(
32+
[
33+
("state", "in", risk_states),
34+
("risk_partner_id", "in", self.mapped("commercial_partner_id").ids),
35+
]
36+
),
37+
)
3238

3339
@api.depends(
3440
"sale_order_ids.order_line.risk_amount",
@@ -59,11 +65,18 @@ def _onchange_risk_currency_id(self):
5965

6066
@api.model
6167
def _risk_field_list(self):
62-
res = super()._risk_field_list()
63-
res.append(
64-
("risk_sale_order", "risk_sale_order_limit", "risk_sale_order_include")
68+
return Domain.AND(
69+
super()._risk_field_list(),
70+
Domain(
71+
[
72+
(
73+
"risk_sale_order",
74+
"risk_sale_order_limit",
75+
"risk_sale_order_include",
76+
)
77+
]
78+
),
6579
)
66-
return res
6780

6881
def _get_field_risk_model_domain(self, field_name):
6982
if field_name == "risk_sale_order":

sale_financial_risk/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
- Stefan Ungureanu
66
- Agathe Mollé \<<agathe.molle@savoirfairelinux.com>\>
77
- Ugne Sinkeviciene \<<ugne@versada.eu>\>
8+
- [Studio73](https://www.studio73.es/):
9+
- Pablo Cortés

sale_financial_risk/static/description/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Sale Financial Risk</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:e01c8b7e6ffe45c71c56e0b59574a8cfb43644087f75958793cd0a2244e82fac
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/credit-control/tree/18.0/sale_financial_risk"><img alt="OCA/credit-control" src="https://img.shields.io/badge/github-OCA%2Fcredit--control-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/credit-control-18-0/credit-control-18-0-sale_financial_risk"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/credit-control&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/credit-control/tree/19.0/sale_financial_risk"><img alt="OCA/credit-control" src="https://img.shields.io/badge/github-OCA%2Fcredit--control-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/credit-control-19-0/credit-control-19-0-sale_financial_risk"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/credit-control&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>Extends Partner Financial Risk to manage sales orders.</p>
379379
<p>Adds a new risk amount field in sale order line to compute risk based on
380380
the difference between ordered quantity (or delivered in some cases) and
@@ -408,7 +408,7 @@ <h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
408408
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/credit-control/issues">GitHub Issues</a>.
409409
In case of trouble, please check there if your issue has already been reported.
410410
If you spotted it first, help us to smash it by providing a detailed and welcomed
411-
<a class="reference external" href="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**">feedback</a>.</p>
411+
<a class="reference external" href="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**">feedback</a>.</p>
412412
<p>Do not contact contributors directly about support or help with technical issues.</p>
413413
</div>
414414
<div class="section" id="credits">
@@ -431,6 +431,10 @@ <h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
431431
</li>
432432
<li>Agathe Mollé &lt;<a class="reference external" href="mailto:agathe.molle&#64;savoirfairelinux.com">agathe.molle&#64;savoirfairelinux.com</a>&gt;</li>
433433
<li>Ugne Sinkeviciene &lt;<a class="reference external" href="mailto:ugne&#64;versada.eu">ugne&#64;versada.eu</a>&gt;</li>
434+
<li><a class="reference external" href="https://www.studio73.es/">Studio73</a>:<ul>
435+
<li>Pablo Cortés</li>
436+
</ul>
437+
</li>
434438
</ul>
435439
</div>
436440
<div class="section" id="maintainers">
@@ -442,7 +446,7 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
442446
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
443447
mission is to support the collaborative development of Odoo features and
444448
promote its widespread use.</p>
445-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/credit-control/tree/18.0/sale_financial_risk">OCA/credit-control</a> project on GitHub.</p>
449+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/credit-control/tree/19.0/sale_financial_risk">OCA/credit-control</a> project on GitHub.</p>
446450
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
447451
</div>
448452
</div>

0 commit comments

Comments
 (0)