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

[MIG][18.0] edi from 13.0 #1130

Closed
wants to merge 158 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
ba6180d
Add edi module
simahawk Nov 19, 2020
1c6a05b
[IMP] edi: define type, record, record create helper
etobella Nov 21, 2020
502cb74
edi: small fix/imp on models
simahawk Nov 23, 2020
8a53c8e
edi: use freezegun for tests
simahawk Nov 23, 2020
f09f401
[IMP] edi: backend add generate_output
etobella Nov 21, 2020
bf3b82c
edi: exchange type validate backend vs type
simahawk Nov 23, 2020
a9d3d6a
edi bump 13.0.1.1.0
simahawk Nov 23, 2020
511c89e
[UPD] README.rst
OCA-git-bot Nov 23, 2020
629a04f
[IMP] edi: Set Send function
etobella Nov 21, 2020
bb1aaf2
edi bump 13.0.1.2.0
etobella Nov 23, 2020
5689692
[UPD] Update edi.pot
oca-travis Nov 25, 2020
2470a69
edi: lookup components by convention
simahawk Nov 24, 2020
7eca050
edi: exchange record backend mandatory
simahawk Nov 24, 2020
b47c132
edi: exchange type backend ondelete=set null
simahawk Nov 24, 2020
77c19ac
[UPD] Update edi.pot
oca-travis Nov 26, 2020
0ce8c13
edi 13.0.1.3.0
OCA-git-bot Nov 26, 2020
7dfaf1c
[IMP] edi: Add mixins
etobella Nov 24, 2020
b40e13d
[UPD] Update edi.pot
oca-travis Nov 26, 2020
ad58dde
edi 13.0.1.4.0
OCA-git-bot Nov 26, 2020
3740602
edi.backend: unify component usage get
simahawk Nov 26, 2020
5741fa8
edi.exchange.record: add handy methods to set/get file
simahawk Nov 26, 2020
fbfb099
edi.backend: add cron to handle record state updates
simahawk Nov 26, 2020
5147e2c
[UPD] Update edi.pot
oca-travis Nov 27, 2020
f9fcbc0
edi 13.0.1.5.0
OCA-git-bot Nov 27, 2020
a9d1990
edi: add specific events, improve record msg lookup
simahawk Nov 27, 2020
edbe383
edi: pass backend to component ctx
simahawk Nov 27, 2020
750f0e0
edi.exchange.record: improve set/get file
simahawk Nov 27, 2020
f6a7b8b
edi.backend: improve exception handling
simahawk Nov 27, 2020
b6e54c1
edi.backend: add docstrings and TODO
simahawk Nov 27, 2020
bd91d62
edi: improve and fix tests
simahawk Nov 28, 2020
9e6eedc
[UPD] Update edi.pot
oca-travis Nov 29, 2020
b699aa3
edi 13.0.1.6.0
OCA-git-bot Nov 29, 2020
9681716
[IMP] edi: Define a processing function for incoming documents
etobella Nov 21, 2020
a9a65ef
edi: sort out components mixins, add input mixins
simahawk Nov 29, 2020
e1da0e0
edi.backend: lookup component by direction too
simahawk Nov 29, 2020
86ca67d
edi: test improve fake components, add input base
simahawk Nov 29, 2020
4116c45
edi: test process w/ fake components
simahawk Nov 29, 2020
9880d93
[IMP] edi: input processing, finishing tests
etobella Nov 29, 2020
1e43705
[UPD] Update edi.pot
oca-travis Nov 30, 2020
6ad3ece
edi 13.0.1.7.0
OCA-git-bot Nov 30, 2020
5c18c38
Add edi_storage
simahawk Nov 27, 2020
1867f5f
edi: fix consumer mixin tests
simahawk Nov 29, 2020
6d49853
edi: add unique identifier
simahawk Nov 29, 2020
f64895e
edi: add external identifier
simahawk Nov 29, 2020
f1d1f01
edi: fix and organize menu items
simahawk Nov 29, 2020
40ea522
edi: disable not ready cron
simahawk Nov 29, 2020
8f7c207
[UPD] Update edi.pot
oca-travis Nov 30, 2020
2e18775
edi 13.0.1.8.0
OCA-git-bot Nov 30, 2020
b884e3b
[IMP] edi: Refactoring views
etobella Nov 29, 2020
eff3d48
[FIX] edi: Missing filter on cron check
etobella Dec 1, 2020
b63f042
[UPD] Update edi.pot
oca-travis Dec 1, 2020
9f9b1a4
edi 13.0.1.8.1
OCA-git-bot Dec 1, 2020
f0ca4e0
edi.backend: return none when component not found
simahawk Nov 30, 2020
8888b00
edi: simplify edi events
simahawk Nov 30, 2020
c14fce7
edi.backend: simplify component lookup
simahawk Dec 1, 2020
ab6bea1
edi: move event triggers to exchange record
simahawk Dec 2, 2020
29b5f95
edi: move and rename _exchange_notify_record to exc rec
simahawk Dec 2, 2020
504975b
edi.backend: rename check method for exchange_process
simahawk Dec 2, 2020
813abbd
[UPD] Update edi.pot
oca-travis Dec 2, 2020
224b057
edi 13.0.1.9.0
OCA-git-bot Dec 2, 2020
95bf3dd
edi: simply ack handling
simahawk Nov 30, 2020
ed5cc97
edi.backend: handle reception of files
simahawk Dec 1, 2020
f74d73a
edi: rename test file for process
simahawk Dec 2, 2020
057546a
edi: cron tests silent logger
simahawk Dec 2, 2020
c66c56f
edi: cron generate ack record when needed
simahawk Dec 2, 2020
17f7b3c
[UPD] Update edi.pot
oca-travis Dec 2, 2020
a03b5bd
edi 13.0.1.10.0
OCA-git-bot Dec 2, 2020
aaf1b26
edi.backend fix _check_input_exchange_sync signature
simahawk Dec 3, 2020
9a4c7dd
[UPD] Update edi.pot
oca-travis Dec 3, 2020
761b0e9
edi 13.0.1.11.0
OCA-git-bot Dec 3, 2020
48635b4
edi: add receive component base mixin
simahawk Dec 2, 2020
1c7d7a5
edi: add type advanced settings
simahawk Dec 3, 2020
124d3df
edi: fix manifest description
simahawk Dec 3, 2020
fa09c53
edi: add base lookup for validators
simahawk Dec 3, 2020
964c177
edi.backend: fix handle reception of files
simahawk Dec 3, 2020
b74a98a
edi: improve validation handling
simahawk Dec 7, 2020
47a7e6d
[UPD] Update edi.pot
oca-travis Dec 8, 2020
81b7de9
[UPD] README.rst
OCA-git-bot Dec 8, 2020
7d1cf3b
edi 13.0.1.12.0
OCA-git-bot Dec 8, 2020
3186a70
[IMP] edi: Security
etobella Nov 30, 2020
1d69117
edi 13.0.1.13.0
OCA-git-bot Dec 8, 2020
0e1d3e7
[IMP] edi: Improve readme
etobella Dec 8, 2020
42431a2
[IMP] edi: Allow to manually generate EDI Exchange records
etobella Dec 8, 2020
d9bf57f
[FIX] edi: Rule not correctly created
etobella Dec 9, 2020
ab4e09f
edi 13.0.1.13.1
OCA-git-bot Dec 9, 2020
1bf9293
[UPD] Update edi.pot
oca-travis Dec 10, 2020
0609594
[UPD] README.rst
OCA-git-bot Dec 10, 2020
b086bbd
edi 13.0.1.14.0
OCA-git-bot Dec 10, 2020
82f2e05
[IMP] edi: Add a has_exchange_record function to search for the speci…
etobella Dec 13, 2020
c830527
[IMP] edi: Keep old field values on the fields_view_get
etobella Dec 13, 2020
e4f220c
edi 13.0.1.14.1
OCA-git-bot Dec 14, 2020
df4ac9e
edi: consumer mixin fix Serialized field usage
simahawk Dec 16, 2020
9eaf19f
edi: component ease access to record
simahawk Dec 16, 2020
175d091
edi: refactor component lookup
simahawk Dec 16, 2020
377a1c4
edi 13.0.1.15.0
OCA-git-bot Mar 10, 2021
b14a8b3
[CHG] edi: Use more permissive licence: AGPL-> LGPL
etobella Mar 10, 2021
9c4e22f
edi.backend: rename generate to match others
simahawk Dec 8, 2020
637bf61
edi: cron call exchange action w/ jobs
simahawk Mar 11, 2021
aa802c3
edi: add jobs configuration
simahawk Dec 8, 2020
176fb83
edi: enable cron for input records
simahawk Mar 11, 2021
185663a
edi: add TODO for cron methods
simahawk Mar 15, 2021
f694e34
edi: _get_component fallback to backend model
simahawk Mar 15, 2021
347d086
[UPD] README.rst
OCA-git-bot Mar 15, 2021
36c55c4
edi 13.0.1.15.1
OCA-git-bot Mar 15, 2021
255f298
[UPD] Update edi.pot
oca-travis Mar 16, 2021
ecb7ca1
edi 13.0.1.16.0
OCA-git-bot Mar 16, 2021
4537d75
[FIX] edi: fix record property when there is no model to return the r…
acsonefho Mar 17, 2021
95e9df1
[FIX] edi: Fix security & filtering
etobella Apr 7, 2021
ddf0e16
[FIX] edi_storage: sort key was not working properly
etobella Apr 7, 2021
41f716c
[IMP] edi: Change security function
etobella Apr 8, 2021
c646eeb
edi 13.0.1.17.0
OCA-git-bot Apr 9, 2021
2cbde40
[FIX] edi: output might be not UTF-8 encodable, like PDFs
etobella Jun 23, 2021
9a5039c
edi 13.0.1.17.1
OCA-git-bot Jun 23, 2021
4f65c67
[13.0][FIX] edi: show the exchange file name while there is no file yet.
LoisRForgeFlow Jun 22, 2021
3188a6f
[13.0][FIX] edi: direction of test exchange record
LoisRForgeFlow Jun 23, 2021
9235ced
edi: add _find_existing_exchange_records to backend
simahawk Jun 23, 2021
016cd61
[UPD] Update edi.pot
oca-travis Jul 2, 2021
3a62f67
edi 13.0.1.18.0
OCA-git-bot Jul 2, 2021
be176b9
[FIX] edi: allow the use of listeners.
LoisRForgeFlow Jul 5, 2021
3c24bd3
edi 13.0.1.19.0
OCA-git-bot Jul 8, 2021
981fb64
edi_backend: update docstring
simahawk Sep 14, 2021
1a8e800
edi_backend: fix var name
simahawk Sep 15, 2021
6b89ad4
edi: exc record get file content as b64 optionally
simahawk Sep 16, 2021
abd7d5b
edi: improve exchange record UI
simahawk Sep 17, 2021
7fba751
edi: allow job channel conf by type
simahawk Sep 19, 2021
7f13295
edi: specific method to get type settings
simahawk Sep 19, 2021
d290953
edi_backend: exclude class name from error txt
simahawk Sep 24, 2021
04b060e
edi: exclude exception class from error msg
simahawk Sep 24, 2021
033a826
edi: improve exchange type and record UI
simahawk Sep 24, 2021
a491ea0
edi: add 'retry' action to exchange record
simahawk Sep 24, 2021
9bebe13
edi: Add button for not auto generated exchange records
etobella Oct 6, 2021
5063fd0
[UPD] Update edi.pot
oca-travis Oct 20, 2021
aed5fa1
edi: improve backend view extension
simahawk Sep 17, 2021
b027eed
edi 13.0.1.20.0
OCA-git-bot Oct 20, 2021
3b2b88d
[IMP] edi: Allow to ignore some jobs
etobella Oct 20, 2021
cd1c68f
[UPD] Update edi.pot
oca-travis Oct 22, 2021
640ddb7
edi 13.0.1.21.0
OCA-git-bot Oct 22, 2021
6c173bf
Fix linting
simahawk Oct 29, 2021
6be1344
edi 13.0.1.21.1
OCA-git-bot Oct 30, 2021
29d8af4
[IMP] edi: ext identifier unique by type and backend
etobella Nov 2, 2021
266df16
[UPD] Update edi.pot
oca-travis Nov 8, 2021
8af6dcd
edi 13.0.1.22.0
OCA-git-bot Nov 8, 2021
863b406
[13.0][FIX] edi: remove span inside anchor to fix exchange record nav…
JordiMForgeFlow Feb 8, 2022
5f83448
edi 13.0.1.22.1
OCA-git-bot Feb 8, 2022
5e1aa75
[IMP] edi: move field edi_auto_disabled to edi.exchange.consumer.mixin
albariera Apr 8, 2022
4fb0b69
[IMP] edi_oca: Pass development status to Beta
etobella Nov 30, 2021
cf2b83e
[UPD] README.rst
OCA-git-bot Apr 25, 2022
da62f24
[IMP] edi: add exchange_filename search
JordiMForgeFlow May 5, 2022
63c7436
edi 13.0.1.23.0
OCA-git-bot May 6, 2022
a463640
[UPD] Update edi.pot
May 16, 2022
e3b58a9
edi 13.0.1.23.1
OCA-git-bot May 16, 2022
7fd91fc
[IMP] edi: archive edi_backend
JaumeBforgeFlow Jul 8, 2022
219dd0c
[UPD] Update edi.pot
Jul 8, 2022
cda6e52
edi 13.0.1.24.0
OCA-git-bot Jul 8, 2022
8c186ca
[UPD] README.rst
OCA-git-bot Sep 3, 2023
4def481
[IMP] edi: pre-commit auto fixes
acsonefho Feb 18, 2025
25ab3fc
[MIG] edi: Migration to 18.0
acsonefho Feb 18, 2025
e0685da
[IMP] edi: minor improvements
acsonefho Feb 18, 2025
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
167 changes: 167 additions & 0 deletions edi/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
===
EDI
===

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b2c2ae892e27d8399b27b3487c8b8af7d8b5f8d7253f9128c8a5e18c9d8f5d38
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github
:target: https://github.com/OCA/edi/tree/18.0/edi
:alt: OCA/edi
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/edi-18-0/edi-18-0-edi
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Base EDI backend.

Provides following models:

1. EDI Backend, to centralize configuration
2. EDI Backend Type, to classify EDI backends (eg: UBL, GS1, e-invoice,
pick-yours)
3. EDI Exchange Type, to define file types of exchange
4. EDI Exchange Record, to define a record exchanged between systems

Also define a mixin to be inherited by records that will generate EDIs

**Table of contents**

.. contents::
:local:

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

This module aims to provide an infrastructure to simplify
interchangability of documents between systems providing a configuration
platform. It will be inherited by other modules in order to define the
proper implementations of components.

In order to define a new Exchange Record, we need to configure:

- Backend Type
- Exchange Type
- Backend
- Components

Component definition
--------------------

The component usage must be defined like edi.{direction}.{kind}.{code}
where:

- direction is output or input
- kind can be: generate, send, check, process, receive
- code is the {backend type code} or {backend type code}.{exchange type
code}

User EDI generation
-------------------

On the exchange type, it might be possible to define a set of models, a
domain and a snippet of code. After defining this fields, we will
automatically see buttons on the view to generate the exchange records.
This configuration is useful to define a way of generation managed by
user.

Usage
=====

After certain operations or manual execution, Exchange records will be
generated. This Exchange records might be input records or outputs
records.

The change of state can be manually executed by the system or be managed
through by ir.cron.

Output Exchange records
-----------------------

An output record is intended to be used for exchange information from
Odoo to another system.

The flow of an output record should be:

- Creation
- Generation of data
- Validation of data
- Sending data
- Validation of data processed properly by the other party

Input Exchange records
----------------------

An input record is intended to be used for exchange information another
system to odoo.

The flow of an input record should be:

- Creation
- Reception of data
- Checking data
- Processing data

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/issues>`_.
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
`feedback <https://github.com/OCA/edi/issues/new?body=module:%20edi%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE

Contributors
------------

- Simone Orsi <simahawk@gmail.com>
- Enric Tobella <etobella@creublanca.es>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px
:target: https://github.com/simahawk
:alt: simahawk

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-simahawk|

This module is part of the `OCA/edi <https://github.com/OCA/edi/tree/18.0/edi>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions edi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import components
from . import models
from . import wizards
44 changes: 44 additions & 0 deletions edi/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "EDI",
"summary": """
Define backends, exchange types, exchange records,
basic automation and views for handling EDI exchanges.
""",
"version": "18.0.1.0.1",
"development_status": "Beta",
"license": "LGPL-3",
"author": "ACSONE,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/edi",
"maintainers": ["simahawk"],
"depends": [
"base_edi",
"component_event",
"mail",
"base_sparse_field",
"queue_job",
],
"external_dependencies": {"python": ["pyyaml"]},
"data": [
"wizards/edi_exchange_record_create.xml",
"data/cron.xml",
"data/sequence.xml",
"data/job_channel.xml",
"data/job_function.xml",
"security/res_groups.xml",
"security/ir_model_access.xml",
"views/edi_backend_views.xml",
"views/edi_backend_type_views.xml",
"views/edi_exchange_record_views.xml",
"views/edi_exchange_type_views.xml",
"views/menuitems.xml",
"templates/exchange_chatter_msg.xml",
"templates/exchange_mixin_buttons.xml",
"templates/assets.xml",
],
"qweb": ["static/src/xml/widget_edi.xml"],
"demo": ["demo/edi_backend_demo.xml"],
}
4 changes: 4 additions & 0 deletions edi/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import base
from . import base_output
from . import base_input
from . import base_validate
65 changes: 65 additions & 0 deletions edi/components/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.addons.component.core import AbstractComponent


class EDIBackendComponentMixin(AbstractComponent):
_name = "edi.component.mixin"
_collection = "edi.backend"
_usage = None
_backend_type = None
_exchange_type = None

@property
def exchange_record(self):
return self.work.exchange_record

@property
def backend(self):
return self.work.backend

@property
def record(self):
return self.work.exchange_record.record

@staticmethod
def _match_attrs():
"""Attributes to be used for matching this component.

By default, match by backend and exchange type.

NOTE: the class attribute must have an underscore, the name here not.
"""
return ("backend_type", "exchange_type")

@classmethod
def _component_match(cls, work, usage=None, model_name=None, **kw):
"""Override to customize match.

Registry lookup filtered by usage and model_name when landing here.
Now, narrow match to `_match_attrs` attributes.
"""
match_attrs = cls._match_attrs()
if not any([kw.get(k) for k in match_attrs]):
# No attr to check
return True

backend_type = kw.get("backend_type")
exchange_type = kw.get("exchange_type")

if cls._backend_type and cls._exchange_type:
# They must match both
return (
cls._backend_type == backend_type
and cls._exchange_type == exchange_type
)

if cls._backend_type not in (None, kw.get("backend_type")):
return False

if cls._exchange_type not in (None, kw.get("exchange_type")):
return False

return True
23 changes: 23 additions & 0 deletions edi/components/base_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.addons.component.core import AbstractComponent


class EDIBackendInputComponentMixin(AbstractComponent):
"""Generate input content."""

_name = "edi.component.input.mixin"
_inherit = "edi.component.mixin"

def process(self):
raise NotImplementedError()


class EDIBackendReceiveComponentMixin(AbstractComponent):
_name = "edi.component.receive.mixin"
_inherit = "edi.component.mixin"

def receive(self):
raise NotImplementedError()
36 changes: 36 additions & 0 deletions edi/components/base_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.addons.component.core import AbstractComponent


class EDIBackendOutputComponentMixin(AbstractComponent):
"""Generate output content."""

_name = "edi.component.output.mixin"
_inherit = "edi.component.mixin"
_usage = "edi.output.generate.*"

def generate(self):
raise NotImplementedError()


class EDIBackendSendComponentMixin(AbstractComponent):
"""Send output records."""

_name = "edi.component.send.mixin"
_inherit = "edi.component.mixin"
_usage = "edi.output.send.*"

def send(self):
raise NotImplementedError()


class EDIBackendCheckComponentMixin(AbstractComponent):
_name = "edi.component.check.mixin"
_inherit = "edi.component.mixin"
_usage = "edi.output.check.*"

def check(self):
raise NotImplementedError()
20 changes: 20 additions & 0 deletions edi/components/base_validate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.addons.component.core import AbstractComponent


class EDIBackendValidateComponentMixin(AbstractComponent):
"""Validate exchange data."""

_name = "edi.component.validate.mixin"
_inherit = "edi.component.mixin"
_usage = "edi.validate.*"

def validate(self, value=None):
self._validate(value)

def _validate(self, value=None):
"""Return None validated, raise `edi.exceptions.EDIValidationError` if not."""
raise NotImplementedError()
Loading
Loading