Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] edi_sale_order_import: DEPRECATE #28

Open
wants to merge 6 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion edi_sale_order_import/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import components
from .hooks import post_load_hook
11 changes: 8 additions & 3 deletions edi_sale_order_import/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

{
"name": "EDI Sale order import",
"summary": """Plug sale_order_import into EDI machinery.""",
"summary": """
MODULE DEPRECATED: use `edi_sale_oca`.

Plug sale_order_import into EDI machinery.""",
"version": "14.0.1.1.0",
"development_status": "Alpha",
"license": "AGPL-3",
"website": "https://github.com/OCA/edi",
"author": "Camptocamp,Odoo Community Association (OCA)",
"maintainers": ["simahawk"],
"depends": ["edi_oca", "sale_order_import"],
"auto_install": True,
# Depend on edi_sale_oca which now provides the component.
"depends": ["edi_sale_oca"],
"auto_install": False,
"data": ["templates/exchange_chatter_msg.xml"],
"post_load": "post_load_hook",
}
1 change: 0 additions & 1 deletion edi_sale_order_import/components/__init__.py

This file was deleted.

73 changes: 0 additions & 73 deletions edi_sale_order_import/components/process.py

This file was deleted.

14 changes: 14 additions & 0 deletions edi_sale_order_import/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

import logging

_logger = logging.getLogger(__name__)


def deprecate():
_logger.warning("`edi_sale_order_import` is deprecated. Use `edi_sale_oca`")


def post_load_hook():
deprecate()
2 changes: 2 additions & 0 deletions edi_sale_order_import/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DEPRECATED: use `edi_sale_oca`.

Plug sale_order_import into EDI machinery.


Expand Down
1 change: 0 additions & 1 deletion edi_sale_order_import/tests/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion edi_sale_order_import/tests/test_process.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2022 Camptocamp SA
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import base64
import textwrap
Expand Down
6 changes: 3 additions & 3 deletions edi_sale_order_import_ubl/README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========================
EDI Sale order import UBL
=========================
======================================
EDI Sale order import UBL (DEPRECATED)
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
1 change: 1 addition & 0 deletions edi_sale_order_import_ubl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .hooks import post_load_hook
17 changes: 11 additions & 6 deletions edi_sale_order_import_ubl/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "EDI Sale order import UBL",
"summary": """Plug sale_order_import_ubl into EDI machinery.""",
"version": "14.0.1.0.0",
"name": "EDI Sale order import UBL (DEPRECATED)",
"summary": """
MODULE DEPRECATED: use `edi_sale_ubl_oca`.

Plug sale_order_import_ubl into EDI machinery.
""",
"version": "14.0.1.1.0",
"development_status": "Alpha",
"license": "AGPL-3",
"website": "https://github.com/OCA/edi",
"author": "Camptocamp,Odoo Community Association (OCA)",
"maintainers": ["simahawk"],
"depends": ["edi_ubl_oca", "edi_sale_order_import", "sale_order_import_ubl"],
"auto_install": True,
"data": ["data/edi_exchange_type.xml"],
"depends": ["edi_sale_ubl_oca"],
"auto_install": False,
"demo": ["demo/edi_exchange_type.xml"],
"post_load": "post_load_hook",
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="edi_exchange_type" model="edi.exchange.type">
<record id="demo_edi_exchange_type" model="edi.exchange.type">
<field name="name">UBL import sale order</field>
<field name="code">ubl_import_so</field>
<field name="backend_type_id" ref="edi_ubl_oca.edi_backend_type_ubl" />
Expand Down
14 changes: 14 additions & 0 deletions edi_sale_order_import_ubl/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

import logging

_logger = logging.getLogger(__name__)


def deprecate():
_logger.warning("`edi_sale_order_import_ubl` is deprecated. Use `edi_sale_ubl_oca`")


def post_load_hook():
deprecate()
26 changes: 26 additions & 0 deletions edi_sale_order_import_ubl/migrations/14.0.1.1.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Camptocamp SA (http://www.camptocamp.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import logging

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)


def migrate(cr, version):
if not version:
return

env = api.Environment(cr, SUPERUSER_ID, {})
# Find and drop XID to avoid losing the record if used.
rec = env["ir.model.data"].search(
[
("name", "=", "edi_exchange_type"),
("module", "=", "edi_sale_order_import_ubl"),
]
)
if rec:
_logger.info("Drop xmlid for edi_sale_order_import_ubl exchange type")
rec.unlink()
return
7 changes: 3 additions & 4 deletions edi_sale_order_import_ubl/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>EDI Sale order import UBL</title>
<title>EDI Sale order import UBL (DEPRECATED)</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,8 +359,8 @@
</style>
</head>
<body>
<div class="document" id="edi-sale-order-import-ubl">
<h1 class="title">EDI Sale order import UBL</h1>
<div class="document" id="edi-sale-order-import-ubl-deprecated">
<h1 class="title">EDI Sale order import UBL (DEPRECATED)</h1>

<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
Expand Down
13 changes: 8 additions & 5 deletions edi_sale_order_import_ubl_endpoint/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Copyright 2021 Camptocamp SA
# @author: Simone Orsi <simone.orsi@camptocamp.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# TODO: rename to `*_example`
{
"name": "EDI Sale order import UBL endpoint",
"summary": """Provide a default endpoint to import SO in UBL format.""",
"summary": """
MODULE DEPRECATED: use `edi_sale_ubl_endpoint_oca`.

Plug sale_order_import_ubl_endpoint into EDI machinery.
""",
"version": "14.0.1.1.0",
"development_status": "Alpha",
"license": "AGPL-3",
"website": "https://github.com/OCA/edi",
"author": "Camptocamp,Odoo Community Association (OCA)",
"maintainers": ["simahawk"],
"depends": ["edi_sale_order_import", "sale_order_import_ubl", "edi_endpoint_oca"],
"auto_install": True,
"data": ["data/endpoint.xml"],
"depends": ["edi_sale_ubl_endpoint_oca"],
"auto_install": False,
"data": [],
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down
5 changes: 5 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ responses
# Python Dependencies
PyYAML
xmlunittest

odoo14-addon-edi_exchange_type_auto @ git+https://github.com/OCA/edi-framework@refs/pull/4/head#subdirectory=setup/edi_exchange_type_auto
odoo14-addon-edi_sale_oca @ git+https://github.com/thienvh332/edi@refs/pull/23/head#subdirectory=setup/edi_sale_oca
odoo14-addon-edi_sale_ubl_oca @ git+https://github.com/thienvh332/edi@refs/pull/24/head#subdirectory=setup/edi_sale_ubl_oca
odoo14-addon-edi_sale_ubl_endpoint_oca @ git+https://github.com/thienvh332/edi@refs/pull/30/head#subdirectory=setup/edi_sale_ubl_endpoint_oca
Loading