Skip to content

Commit 67b0dfa

Browse files
committed
[17.0][MIG] delivery_roulier_chronopost_fr: Migration to 17.0
1 parent 00cd614 commit 67b0dfa

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

delivery_roulier_chronopost_fr/__manifest__.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
{
44
"name": "Delivery Chronopost France",
5-
"version": "14.0.1.0.1",
5+
"version": "17.0.1.0.1",
66
"author": "Akretion,Odoo Community Association (OCA)",
77
"category": "Delivery",
88
"complexity": "normal",
9-
"depends": [
10-
"delivery_roulier_option",
11-
],
9+
"depends": ["delivery_roulier_option"],
1210
"website": "https://github.com/OCA/delivery-carrier",
1311
"data": [
1412
"views/carrier_account.xml",

delivery_roulier_chronopost_fr/tests/test_label_chronopost.py

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
22

3-
from vcr_unittest import VCRMixin
3+
import pytest
44

55
from odoo.addons.base_delivery_carrier_label.tests import carrier_label_case
66

77

8-
class ChronopostLabelCase(VCRMixin, carrier_label_case.CarrierLabelCase):
9-
def setUp(self, *args, **kwargs):
8+
class ChronopostLabelCase(carrier_label_case.TestCarrierLabel):
9+
@classmethod
10+
def setUpClass(cls):
1011
# need it to be defined before super to avoid failure in _hide_sensitive_data
11-
self.account = False
12-
super().setUp(*args, **kwargs)
12+
cls.account = False
13+
super().setUpClass()
14+
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
1315
# french carrier sender need to be from France
14-
self.picking.company_id.partner_id.write(
15-
{"country_id": self.env.ref("base.fr").id}
16+
cls.picking.company_id.partner_id.write(
17+
{"country_id": cls.env.ref("base.fr").id}
1618
)
1719
# change account and password with valid credentials to regenerate the cassette
18-
self.account = self.env["carrier.account"].create(
20+
cls.account = cls.env["carrier.account"].create(
1921
{
2022
"name": "Chronopost Test Account",
2123
"delivery_type": "chronopost_fr",
@@ -25,6 +27,7 @@ def setUp(self, *args, **kwargs):
2527
}
2628
)
2729

30+
@classmethod
2831
def _hide_sensitive_data(self, request):
2932
password = self.account and self.account.password or "dummy"
3033
account = self.account and self.account.account or "dummy"
@@ -34,8 +37,12 @@ def _hide_sensitive_data(self, request):
3437
request.body = body
3538
return request
3639

37-
def _get_vcr_kwargs(self, **kwargs):
40+
@classmethod
41+
@pytest.fixture(scope="module")
42+
def vcr_config(self):
3843
return {
44+
"filter_headers": ["authorization"],
45+
"ignore_localhost": True,
3946
"record_mode": "once",
4047
"match_on": ["method", "path"],
4148
"decode_compressed_response": True,

delivery_roulier_chronopost_fr/views/carrier_account.xml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo>
33

4-
<record id="view_chronopost_carrier_account_form" model="ir.ui.view">
4+
<record id="view_chronopost_carrier_account_form" model="ir.ui.view">
55
<field name="model">carrier.account</field>
66
<field
77
name="inherit_id"
8-
ref="base_delivery_carrier_label.carrier_account_view_form"
8+
ref="delivery_carrier_account.carrier_account_view_form"
99
/>
1010
<field name="arch" type="xml">
1111
<field name="account" position="after">
1212
<field
1313
name="chronopost_fr_subaccount"
14-
attrs="{'invisible': [('delivery_type', '!=', 'chronopost_fr')]}"
14+
invisible="delivery_type != 'chronopost_fr'"
1515
/>
1616
</field>
1717
<field name="password" position="after">
1818
<field
1919
name="chronopost_fr_file_format"
20-
attrs="{'invisible': [('delivery_type', '!=', 'chronopost_fr')], 'required': [('name', '=', 'chronopost')]}"
20+
invisible="delivery_type != 'chronopost_fr'"
21+
required="name != 'chronopost'"
2122
/>
2223
</field>
2324
</field>

test-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# delivery_roulier
22
odoo_test_helper
3+
# delivery_roulier_chronopost_fr
4+
pytest-recording

0 commit comments

Comments
 (0)