-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
23 changed files
with
1,668 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
===================== | ||
EDI Exchange Template | ||
===================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:77f9c8f1d2157e0270a1eadf85a1d39476fdefc8e14bc5cfe0fb47c3dadf118e | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/15.0/edi_exchange_template_oca | ||
:alt: OCA/edi | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/edi-15-0/edi-15-0-edi_exchange_template_oca | ||
: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=15.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Provide EDI exchange templates to control input/output records contents. | ||
|
||
Provides following models: | ||
|
||
1. EDI exchange output template, generates output using QWeb templates | ||
2. [TODO] EDI exchange input template | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
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_exchange_template_oca%0Aversion:%2015.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 <[email protected]> | ||
|
||
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/15.0/edi_exchange_template_oca>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2020 ACSONE | ||
# @author: Simone Orsi <[email protected]> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
{ | ||
"name": "EDI Exchange Template", | ||
"summary": """Allows definition of exchanges via templates.""", | ||
"version": "16.0.1.0.0", | ||
"development_status": "Beta", | ||
"license": "LGPL-3", | ||
"author": "ACSONE,Odoo Community Association (OCA)", | ||
"maintainers": ["simahawk"], | ||
"website": "https://github.com/OCA/edi-framework", | ||
"depends": ["edi_oca", "component"], | ||
"data": [ | ||
"security/ir_model_access.xml", | ||
"views/edi_exchange_template_output_views.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import common | ||
from . import output_mixin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2020 ACSONE | ||
# @author: Simone Orsi <[email protected]> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo.addons.component.core import AbstractComponent | ||
|
||
|
||
class EDIExchangeInfoMixin(AbstractComponent): | ||
"""Abstract component mixin provide info for exchanges.""" | ||
|
||
# TODO: this should be moved to core and renamed to `data`. | ||
# A `data` component could be used for both incoming and outgoing. | ||
|
||
_name = "edi.info.provider.mixin" | ||
_collection = "edi.backend" | ||
# Enable validation of work context attributes | ||
_work_context_validate_attrs = [] | ||
|
||
def __init__(self, work_context): | ||
super().__init__(work_context) | ||
for key in self._work_context_validate_attrs: | ||
if not hasattr(work_context, key): | ||
raise AttributeError(f"`{key}` is required for this component!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2020 ACSONE | ||
# @author: Simone Orsi <[email protected]> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
import datetime | ||
|
||
import pytz | ||
|
||
from odoo import fields | ||
|
||
from odoo.addons.component.core import AbstractComponent | ||
|
||
|
||
class EDIExchangeInfoOutputMixin(AbstractComponent): | ||
"""Abstract component mixin to generate GS1 compliant XML files.""" | ||
|
||
_name = "edi.output.mixin" | ||
_inherit = "edi.info.provider.mixin" | ||
# Enable validation of work context attributes | ||
_work_context_validate_attrs = ["exchange_record"] | ||
|
||
@property | ||
def record(self): | ||
return self.work.exchange_record.record | ||
|
||
def generate_info(self): | ||
"""Generate and return data for output info. | ||
:return: odoo.tools.DotDict | ||
""" | ||
raise NotImplementedError() | ||
|
||
# helper methods | ||
@staticmethod | ||
def _utc_now(): | ||
return datetime.datetime.utcnow().isoformat() | ||
|
||
@staticmethod | ||
def date_to_string(dt, utc=True): | ||
if utc: | ||
dt = dt.astimezone(pytz.UTC) | ||
return fields.Date.to_string(dt) |
184 changes: 184 additions & 0 deletions
184
edi_exchange_template_oca/i18n/edi_exchange_template.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * edi_exchange_template | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__backend_id | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__backend_id | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_search | ||
msgid "Backend" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_search | ||
msgid "Backend type" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__code | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__code | ||
msgid "Code" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__code_snippet | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__code_snippet | ||
msgid "Code Snippet" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__code_snippet_docs | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__code_snippet_docs | ||
msgid "Code Snippet Docs" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_form | ||
msgid "Code snippet" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_form | ||
msgid "Code snippet docs" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__create_uid | ||
msgid "Created by" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__create_date | ||
msgid "Created on" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__display_name | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model,name:edi_exchange_template.model_edi_backend | ||
msgid "EDI Backend" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__backend_type_id | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__backend_type_id | ||
msgid "EDI Backend type" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model,name:edi_exchange_template.model_edi_exchange_template_mixin | ||
msgid "EDI Exchange Output Mixin" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model,name:edi_exchange_template.model_edi_exchange_template_output | ||
msgid "EDI Exchange Output Template" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.actions.act_window,name:edi_exchange_template.act_open_edi_exchange_template_output_view | ||
#: model:ir.ui.menu,name:edi_exchange_template.menu_edi_exchange_template_output | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_form | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_search | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_tree | ||
msgid "EDI Exchange Template Output" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.ui.menu,name:edi_exchange_template.menu_edi_exchange_template_root | ||
msgid "EDI Exchange Templates" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__type_id | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__type_id | ||
msgid "EDI Exchange type" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_search | ||
msgid "Group By" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__id | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,help:edi_exchange_template.field_edi_exchange_template_output__template_key | ||
msgid "ID of the view defined in xml file" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin____last_update | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__write_uid | ||
msgid "Last Updated by" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__write_date | ||
msgid "Last Updated on" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_mixin__name | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__name | ||
msgid "Name" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__output_type | ||
msgid "Output Type" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__template_arch | ||
msgid "QWeb arch" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__template_id | ||
msgid "Qweb Template" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_form | ||
msgid "Template" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,field_description:edi_exchange_template.field_edi_exchange_template_output__template_key | ||
msgid "Template key" | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model:ir.model.fields,help:edi_exchange_template.field_edi_exchange_template_output__template_arch | ||
msgid "This field stores the view arch." | ||
msgstr "" | ||
|
||
#. module: edi_exchange_template | ||
#: model_terms:ir.ui.view,arch_db:edi_exchange_template.edi_exchange_template_output_view_search | ||
msgid "Type" | ||
msgstr "" |
Oops, something went wrong.