Skip to content

Commit 12f6dbf

Browse files
[MIG] edi_purchase_oca: Migration to v19
1 parent 7669a15 commit 12f6dbf

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

edi_purchase_oca/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"name": "EDI Purchase",
66
"summary": """
77
Define EDI Configuration for Purchase Orders""",
8-
"version": "18.0.1.0.0",
8+
"version": "19.0.1.0.0",
99
"license": "LGPL-3",
1010
"author": "ForgeFlow, Camptocamp, Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/edi-framework",
12-
"depends": ["purchase", "edi_oca", "component_event"],
12+
"depends": ["purchase", "edi_core_oca", "component_event"],
1313
"data": [
1414
"views/purchase_order_views.xml",
1515
"views/edi_exchange_record_views.xml",

edi_purchase_oca/models/res_partner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
from odoo import fields, models
6+
from odoo.fields import Domain
67

78

89
class ResPartner(models.Model):
@@ -14,5 +15,5 @@ class ResPartner(models.Model):
1415
relation="res_partner_edi_purchase_configuration_rel",
1516
column1="partner_id",
1617
column2="conf_id",
17-
domain=[("model_name", "=", "purchase.order")],
18+
domain=Domain("model_name", "=", "purchase.order"),
1819
)

edi_purchase_oca/tests/test_edi_conf.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from odoo import Command
77

8-
from odoo.addons.edi_oca.tests.common import EDIBackendCommonComponentTestCase
8+
from odoo.addons.edi_component_oca.tests.common import EDIBackendCommonComponentTestCase
99

1010

1111
class TestsPurchaseEDIConfiguration(EDIBackendCommonComponentTestCase):
@@ -19,8 +19,28 @@ def setUpClass(cls):
1919
"default_code": "1234567",
2020
}
2121
)
22-
cls.exc_type_out = cls.env.ref("edi_purchase_oca.demo_edi_exc_type_order_out")
23-
cls.edi_conf = cls.env.ref("edi_purchase_oca.demo_edi_configuration_confirmed")
22+
cls.exc_type_out = cls._create_exchange_type(
23+
name="Demo Purchase Order out",
24+
code="demo_PurchaseOrder_out",
25+
direction="output",
26+
exchange_filename_pattern="{record_name}-{type.code}-{dt}",
27+
exchange_file_ext="xml",
28+
)
29+
cls.edi_conf = cls.env["edi.configuration"].create(
30+
{
31+
"name": "Demo PO send",
32+
"type_id": cls.exc_type_out.id,
33+
"backend_id": cls.backend.id,
34+
"model_id": cls.env["ir.model"]._get_id("purchase.order"),
35+
"trigger_id": cls.env.ref(
36+
"edi_purchase_oca.edi_conf_trigger_purchase_order_state_change"
37+
).id,
38+
"snippet_do": (
39+
"if record.state == 'purchase':\n"
40+
" record._edi_send_via_edi(conf.type_id)"
41+
),
42+
}
43+
)
2444
cls.partner.edi_purchase_conf_ids = cls.edi_conf
2545

2646
@mock.patch("odoo.addons.edi_core_oca.models.edi_backend.EDIBackend._validate_data")

0 commit comments

Comments
 (0)