Skip to content

Commit

Permalink
[MIG] account_payment_return_financial_risk: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-lopez-tecnativa committed Sep 2, 2024
1 parent f82e23f commit eaa9cce
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 23 deletions.
6 changes: 6 additions & 0 deletions account_payment_return_financial_risk/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ orders.
.. contents::
:local:

Configuration
=============

Refer to the module 'account_financial_risk' configuration for the
initial steps

Usage
=====

Expand Down
2 changes: 1 addition & 1 deletion account_payment_return_financial_risk/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Partner Payment Return Risk",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"category": "Sales Management",
"website": "https://github.com/OCA/credit-control",
Expand Down
8 changes: 4 additions & 4 deletions account_payment_return_financial_risk/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ def _risk_account_groups(self):
("account_type", "=", "asset_receivable"),
("partial_reconcile_returned_ids", "!=", False),
],
"fields": ["partner_id", "account_id", "amount_residual"],
"fields": ["amount_residual:sum"],
"group_by": ["partner_id", "account_id"],
}
return res

def _prepare_risk_account_vals(self, groups):
vals = super()._prepare_risk_account_vals(groups)
vals["risk_payment_return"] = sum(
reg["amount_residual"]
for reg in groups["returned"]["read_group"]
if reg["partner_id"][0] == self.id
amount_residual
for (partner, account, amount_residual) in groups["returned"]["read_group"]
if partner.id == self.id
)
return vals

Expand Down
1 change: 1 addition & 0 deletions account_payment_return_financial_risk/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refer to the module 'account_financial_risk' configuration for the initial steps
30 changes: 18 additions & 12 deletions account_payment_return_financial_risk/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,24 @@ <h1 class="title">Partner Payment Return Risk</h1>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>Refer to the module ‘account_financial_risk’ configuration for the
initial steps</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <em>Customers &gt; Financial Risk</em></li>
Expand All @@ -401,23 +407,23 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/credit-control/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/credit-control/issues/new?body=module:%20account_payment_return_financial_risk%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Carlos Dauden</li>
Expand All @@ -427,7 +433,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.tests import Form, common
from odoo.tests import Form

from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
from odoo.addons.base.tests.common import BaseCommon


class TestPartnerPaymentReturnRisk(common.TransactionCase):
class TestPartnerPaymentReturnRisk(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.journal = cls.env["account.journal"].create(
{"name": "Test Sales Journal", "code": "tVEN", "type": "sale"}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<field name="risk_account_amount_include" position="before">
<field
name="risk_payment_return_include"
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"
readonly="not risk_allow_edit"
/>
<button
name="open_risk_pivot_info"
Expand All @@ -23,7 +23,7 @@
<field name="risk_account_amount_limit" position="before">
<field
name="risk_payment_return_limit"
attrs="{'readonly': [('risk_allow_edit', '=', False)]}"
readonly="not risk_allow_edit"
/>
</field>
</field>
Expand Down

0 comments on commit eaa9cce

Please sign in to comment.