Skip to content

Commit 70d9e0f

Browse files
[MIG] account_payment_mode: Migration to 18.0
1 parent d6ae21d commit 70d9e0f

11 files changed

Lines changed: 56 additions & 51 deletions

File tree

account_payment_mode/README.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Account Payment Mode
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github
20-
:target: https://github.com/OCA/bank-payment/tree/17.0/account_payment_mode
20+
:target: https://github.com/OCA/bank-payment/tree/18.0/account_payment_mode
2121
:alt: OCA/bank-payment
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/bank-payment-17-0/bank-payment-17-0-account_payment_mode
23+
:target: https://translation.odoo-community.org/projects/bank-payment-18-0/bank-payment-18-0-account_payment_mode
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -55,7 +55,7 @@ Bug Tracker
5555
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-payment/issues>`_.
5656
In case of trouble, please check there if your issue has already been reported.
5757
If you spotted it first, help us to smash it by providing a detailed and welcomed
58-
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_mode%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
58+
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_mode%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5959

6060
Do not contact contributors directly about support or help with technical issues.
6161

@@ -70,11 +70,12 @@ Authors
7070
Contributors
7171
------------
7272

73-
- Alexis de Lattre <alexis.delattre@akretion.com>
74-
- Eric Lembregts <eric@lembregts.eu>
75-
- Andrea Stirpe <a.stirpe@onestein.nl>
76-
- Marçal Isern <marsal.isern@qubiq.es>
77-
- Miquel Alzanillas <malzanillas@apsl.net>
73+
- Alexis de Lattre <alexis.delattre@akretion.com>
74+
- Eric Lembregts <eric@lembregts.eu>
75+
- Andrea Stirpe <a.stirpe@onestein.nl>
76+
- Marçal Isern <marsal.isern@qubiq.es>
77+
- Miquel Alzanillas <malzanillas@apsl.net>
78+
- Bert Van Groenendael <bert.vangroenendael@dynapps.eu>
7879

7980
Maintainers
8081
-----------
@@ -89,6 +90,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8990
mission is to support the collaborative development of Odoo features and
9091
promote its widespread use.
9192

92-
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/17.0/account_payment_mode>`_ project on GitHub.
93+
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/18.0/account_payment_mode>`_ project on GitHub.
9394

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

account_payment_mode/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Account Payment Mode",
7-
"version": "17.0.1.0.2",
7+
"version": "18.0.1.0.0",
88
"development_status": "Mature",
99
"license": "AGPL-3",
1010
"author": "Akretion,Odoo Community Association (OCA)",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
<record id="account_payment_mode_company_rule" model="ir.rule">
4+
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
5+
</record>
6+
</odoo>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2025 Tecnativa - Carlos Lopez
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from openupgradelib import openupgrade
5+
6+
7+
@openupgrade.migrate()
8+
def migrate(env, version):
9+
openupgrade.load_data(
10+
env, "account_payment_mode", "migrations/18.0.1.0.0/noupdate_changes.xml"
11+
)

account_payment_mode/models/account_payment_method.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ class AccountPaymentMethod(models.Model):
2626
)
2727

2828
@api.depends("code", "name", "payment_type")
29-
def name_get(self):
30-
result = []
29+
def _compute_display_name(self):
3130
for method in self:
32-
result.append(
33-
(
34-
method.id,
35-
f"[{method.code}] {method.name} ({method.payment_type})",
36-
)
31+
method.display_name = (
32+
f"[{method.code}] {method.name} ({method.payment_type})"
3733
)
38-
return result

account_payment_mode/readme/CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
- Andrea Stirpe \<<a.stirpe@onestein.nl>\>
44
- Marçal Isern \<<marsal.isern@qubiq.es>\>
55
- Miquel Alzanillas \<<malzanillas@apsl.net>\>
6+
- Bert Van Groenendael \<<bert.vangroenendael@dynapps.eu>\>

account_payment_mode/security/account_payment_mode.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<field name="name">Payment mode multi-company rule</field>
55
<field name="model_id" ref="model_account_payment_mode" />
66
<field name="domain_force">
7-
['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]
7+
[('company_id', 'in', company_ids)]
88
</field>
99
</record>
1010
</odoo>

account_payment_mode/static/description/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Account Payment Mode</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:05b51bb50a6ce795b9c709cb7f50965bb1c89dd6f96469da94ad4b7520ba3330
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-payment/tree/17.0/account_payment_mode"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-17-0/bank-payment-17-0-account_payment_mode"><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/bank-payment&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-payment/tree/18.0/account_payment_mode"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-18-0/bank-payment-18-0-account_payment_mode"><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/bank-payment&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module adds a new object <em>account.payment.mode</em>, that is used to
374374
better classify and route incoming/outgoing payment orders with the
375375
banks.</p>
@@ -402,7 +402,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
402402
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-payment/issues">GitHub Issues</a>.
403403
In case of trouble, please check there if your issue has already been reported.
404404
If you spotted it first, help us to smash it by providing a detailed and welcomed
405-
<a class="reference external" href="https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_mode%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
405+
<a class="reference external" href="https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_mode%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
406406
<p>Do not contact contributors directly about support or help with technical issues.</p>
407407
</div>
408408
<div class="section" id="credits">
@@ -421,6 +421,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
421421
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
422422
<li>Marçal Isern &lt;<a class="reference external" href="mailto:marsal.isern&#64;qubiq.es">marsal.isern&#64;qubiq.es</a>&gt;</li>
423423
<li>Miquel Alzanillas &lt;<a class="reference external" href="mailto:malzanillas&#64;apsl.net">malzanillas&#64;apsl.net</a>&gt;</li>
424+
<li>Bert Van Groenendael &lt;<a class="reference external" href="mailto:bert.vangroenendael&#64;dynapps.eu">bert.vangroenendael&#64;dynapps.eu</a>&gt;</li>
424425
</ul>
425426
</div>
426427
<div class="section" id="maintainers">
@@ -432,7 +433,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
432433
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
433434
mission is to support the collaborative development of Odoo features and
434435
promote its widespread use.</p>
435-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-payment/tree/17.0/account_payment_mode">OCA/bank-payment</a> project on GitHub.</p>
436+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-payment/tree/18.0/account_payment_mode">OCA/bank-payment</a> project on GitHub.</p>
436437
<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>
437438
</div>
438439
</div>

account_payment_mode/tests/test_account_payment_mode.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# Copyright 2016-2020 ForgeFlow S.L.
22
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
33

4+
from odoo import Command
45
from odoo.exceptions import UserError, ValidationError
5-
from odoo.tests.common import TransactionCase
66

7-
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
7+
from odoo.addons.base.tests.common import BaseCommon
88

99

10-
class TestAccountPaymentMode(TransactionCase):
10+
class TestAccountPaymentMode(BaseCommon):
1111
@classmethod
1212
def setUpClass(cls):
1313
super().setUpClass()
14-
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
15-
1614
cls.res_users_model = cls.env["res.users"]
1715
cls.journal_model = cls.env["account.journal"]
1816
cls.payment_mode_model = cls.env["account.payment.mode"]
@@ -60,9 +58,7 @@ def test_payment_mode_company_consistency_change(self):
6058
self.payment_mode_c1.write(
6159
{
6260
"variable_journal_ids": [
63-
(
64-
6,
65-
0,
61+
Command.set(
6662
[
6763
self.journal_c1.id,
6864
self.journal_c2.id,

account_payment_mode/views/account_payment_method.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ here. I hate the objects that don't have a view... -->
77
<field name="name">account_payment_method.form</field>
88
<field name="model">account.payment.method</field>
99
<field name="arch" type="xml">
10-
<form string="Payment Method">
10+
<form>
1111
<sheet>
1212
<widget
1313
name="web_ribbon"
@@ -27,21 +27,21 @@ here. I hate the objects that don't have a view... -->
2727
</field>
2828
</record>
2929
<record id="account_payment_method_tree" model="ir.ui.view">
30-
<field name="name">account_payment_method.tree</field>
30+
<field name="name">account_payment_method.list</field>
3131
<field name="model">account.payment.method</field>
3232
<field name="arch" type="xml">
33-
<tree>
33+
<list>
3434
<field name="name" />
3535
<field name="code" />
3636
<field name="payment_type" />
37-
</tree>
37+
</list>
3838
</field>
3939
</record>
4040
<record id="account_payment_method_search" model="ir.ui.view">
4141
<field name="name">account_payment_method.search</field>
4242
<field name="model">account.payment.method</field>
4343
<field name="arch" type="xml">
44-
<search string="Search Payment Methods">
44+
<search>
4545
<field
4646
name="name"
4747
filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]"
@@ -70,7 +70,7 @@ here. I hate the objects that don't have a view... -->
7070
<record id="account_payment_method_action" model="ir.actions.act_window">
7171
<field name="name">Payment Methods</field>
7272
<field name="res_model">account.payment.method</field>
73-
<field name="view_mode">tree,form</field>
73+
<field name="view_mode">list,form</field>
7474
</record>
7575
<menuitem
7676
id="account_payment_method_menu"

0 commit comments

Comments
 (0)