Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3bfcdcf
Add edi_gs1
simahawk Jul 9, 2020
ef695ee
edi_gs1: fix output tests
simahawk Nov 26, 2020
39fc532
edi_gs1: BH instance identifier = record identifier
simahawk Dec 2, 2020
6c8b1b4
edi_gs1: add basic types for ack
simahawk Dec 2, 2020
e396af1
edi_gs1: add basic component for output
simahawk Dec 2, 2020
8275866
edi_gs1: add schemas for warehouse exchanges
simahawk Dec 2, 2020
9c606ca
edi_gs1: clean dead code
simahawk Dec 2, 2020
9a2e52c
edi_gs1: depend on edi_xml
simahawk Dec 3, 2020
ce96622
edi_gs1: component has only exc record in ctx
simahawk Dec 3, 2020
706d19b
edi_gs1: SBH tests validate xml
simahawk Dec 4, 2020
d01bb2d
edi: draft gs1 input mixin
simahawk Dec 4, 2020
27dafe8
DROPME: add TODOs
simahawk Mar 11, 2021
75ba63a
edi_gs1: adapt tests to core changes
simahawk Mar 15, 2021
1d02985
[ADD] edi_gs1: add gs1_code on UoM (+ auto init based on default valu…
acsonefho Mar 17, 2021
2687337
edi_exchange_template: rework info provider mixins
simahawk Mar 15, 2021
e889286
edi_gs1: add gs1_code to UoM
simahawk Mar 18, 2021
040c8d4
edi_gs1_stock: improve outbound instruction
simahawk Mar 18, 2021
69dd953
edi_gs1: split ack data type + imp conf
simahawk Mar 18, 2021
635c546
edi_gs1: draft ack input process component
simahawk Mar 18, 2021
bb78bb4
[ADD] edi_gs1: lsp and lsc partners on backend
acsonefho Mar 31, 2021
688bf51
[FIX] edi_gs1: empty doc_type invalidate the document generation
acsonefho Mar 31, 2021
e8717c9
[UPD] edi_gs1: update group on security
acsonefho Mar 31, 2021
3cf9f49
Pre-commit
acsonefho Apr 16, 2021
04c4a3b
[FIX] Fix unit test about output generation + missing security rules
acsonefho Apr 16, 2021
63e7e61
[UPD] GS1 .xsd files update
acsonefho Jul 2, 2021
86b5c30
[FIX] edi_gs1: fix typo and find_component.
acsonefho Jul 2, 2021
de48762
[FIX] edi: fix due to refactor
acsonefho Jul 9, 2021
c82f10b
[GS1] Generate the Warehouse Outbound Notification ACK
acsonefho Nov 24, 2022
935d5a9
[FIX] edi_gs1: remove useless _xsd_schema_path
acsonefho Dec 15, 2022
8e1d4db
[IMP] edi_gs1_oca: pre-commit auto fixes
acsonefho Jun 19, 2026
ada475e
[MIG] edi_gs1_oca: migration to 19.0
acsonefho Jun 29, 2026
4dabf7a
[IMP] edi_gs1_oca: move to Beta development status
acsonefho Jul 2, 2026
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
89 changes: 89 additions & 0 deletions edi_gs1_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============
Base GS1 EDI
============

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

.. |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/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github
:target: https://github.com/OCA/edi-framework/tree/19.0/edi_gs1_oca
:alt: OCA/edi-framework
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/edi-framework-19-0/edi-framework-19-0-edi_gs1_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-framework&target_branch=19.0
:alt: Try me on Runboat

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

This is the base module for the implementation of the `GS1 -The Global
Language of Business <http://gs1.org/>`__ standard.

This module contains methods to generate and parse XML files compliant
with this standard.

Beside basic machinery it provides common components to generate common
GS1 schema elements. Namely:

- StandardBusinessDocumentHeader

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi-framework/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-framework/issues/new?body=module:%20edi_gs1_oca%0Aversion:%2019.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>

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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
13 changes: 13 additions & 0 deletions edi_gs1_oca/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Inbound Instruction

- [x] allow skipping keys / elements by returning none
- [x] check UOM code handling
- [x] finish mapping of what we know
- [] draft RF-EFR module w/ tests
- [] allow export from PO
- [] handle state of export
- [] use storage backend to store it
- [] add lookup of acknowledge message
- [] add new field code to UOM
- [] draft send ack
- [] draft Outbound Notification parse
2 changes: 2 additions & 0 deletions edi_gs1_oca/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
28 changes: 28 additions & 0 deletions edi_gs1_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2020 ACSONE
# @author: Simone Orsi <simahawk@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Base GS1 EDI",
"summary": """
Base module for GS1 standard EDI exchange""",
"version": "19.0.1.0.0",
"development_status": "Beta",
"license": "AGPL-3",
"website": "https://github.com/OCA/edi-framework",
"author": "ACSONE,Odoo Community Association (OCA)",
"depends": ["edi_core_oca", "uom"],
"external_dependencies": {"python": ["xmlschema", "xmlunittest"]},
"data": [
"security/gs1_backend_acl.xml",
"data/gs1_backend_data.xml",
"data/ack_in_exchange_type_data.xml",
"data/ack_out_exchange_type_data.xml",
"data/business_header_qweb_template.xml",
"data/contact_details_qweb_template.xml",
"views/res_partner.xml",
"views/edi_backend.xml",
"views/uom_uom.xml",
],
"post_init_hook": "post_init_hook",
}
25 changes: 25 additions & 0 deletions edi_gs1_oca/data/ack_in_exchange_type_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="edi_exchange_type_receipt_ack_in" model="edi.exchange.type">
<field name="backend_type_id" ref="backend_type_gs1" />
<field name="name">GS1 ApplicationReceiptAcknowledgement</field>
<field name="code">applicationReceiptAcknowledgement_in</field>
<field name="direction">input</field>
<!--
When this field is empty for "input ack"
we assume that we can rely on the original file name (of the parent record)
and a suffix ".ack".
-->
<field name="exchange_filename_pattern" />
<field name="exchange_file_ext">xml</field>
<field name="input_validate_model_id" ref="model_edi_gs1_handler_validate" />
<field
name="process_model_id"
ref="model_edi_gs1_handler_application_receipt_ack"
/>
<field name="advanced_settings_edit">
gs1:
schema_path: edi_gs1_oca:static/schemas/gs1/ecom/ApplicationReceiptAcknowledgement.xsd
</field>
</record>
</odoo>
17 changes: 17 additions & 0 deletions edi_gs1_oca/data/ack_out_exchange_type_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="edi_exchange_type_receipt_ack_out" model="edi.exchange.type">
<field name="backend_type_id" ref="backend_type_gs1" />
<field name="name">GS1 ApplicationReceiptAcknowledgement</field>
<field name="code">applicationReceiptAcknowledgement_out</field>
<field name="direction">output</field>
<field name="send_model_id" ref="edi_core_oca.model_edi_oca_handler_noop" />
<field name="exchange_filename_pattern">{record_name}-{type.code}-{dt}</field>
<field name="exchange_file_ext">xml</field>
<field name="output_validate_model_id" ref="model_edi_gs1_handler_validate" />
<field name="advanced_settings_edit">
gs1:
schema_path: edi_gs1_oca:static/schemas/gs1/ecom/ApplicationReceiptAcknowledgement.xsd
</field>
</record>
</odoo>
65 changes: 65 additions & 0 deletions edi_gs1_oca/data/business_header_qweb_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template
id="edi_exchange_business_header_contact"
name="Render GS1 Business header contact"
>
<!--
`nswrapper` is a trick to be able to import these templates
as XML because a namespace is mandatory for element prefixes.
`nswrapper` elements are purged afterwards in post-processing.
-->
<nswrapper
xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<sh:Identifier Authority="GS1" />
<sh:ContactInformation>
<sh:Contact t-esc="partner.name">John Doe</sh:Contact>
<sh:EmailAddress
t-esc="partner.email"
>John_Doe@purchasing.XYZretailer.com</sh:EmailAddress>
<sh:TelephoneNumber
t-esc="partner.phone"
>+1-212-555-2122</sh:TelephoneNumber>
<sh:ContactTypeIdentifier
t-esc="contact_indentifier"
>Buyer</sh:ContactTypeIdentifier>
</sh:ContactInformation>
</nswrapper>
</template>
<template id="edi_exchange_business_header" name="Render GS1 Business header">
<nswrapper
xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
<sh:Sender>
<t t-call="edi_gs1_oca.edi_exchange_business_header_contact">
<t t-set="partner" t-value="sender" />
<t t-set="contact_indentifier" t-value="'Buyer'" />
</t>
</sh:Sender>
<sh:Receiver>
<t t-call="edi_gs1_oca.edi_exchange_business_header_contact">
<t t-set="partner" t-value="receiver" />
<t t-set="contact_indentifier" t-value="'Seller'" />
</t>
</sh:Receiver>
<sh:DocumentIdentification>
<sh:Standard>GS1</sh:Standard>
<sh:TypeVersion>3.4</sh:TypeVersion>
<sh:InstanceIdentifier
t-esc="instance_identifier"
>100002</sh:InstanceIdentifier>
<sh:Type t-esc="doc_type or ''" />
<sh:MultipleType>false</sh:MultipleType>
<sh:CreationDateAndTime
t-esc="utc_now()"
>2006-01-10T12:00:01.000-05:00</sh:CreationDateAndTime>
</sh:DocumentIdentification>
</sh:StandardBusinessDocumentHeader>
</nswrapper>
</template>
</odoo>
47 changes: 47 additions & 0 deletions edi_gs1_oca/data/contact_details_qweb_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="edi_exchange_contact_details" name="Render GS1 Contact Details">
<t t-set="company" t-value="contact.parent_id" />
<gln t-esc="contact.gln_code">0000000000044</gln>
<additionalPartyIdentification
t-if="additionalPartyIdentification"
t-att="additionalPartyIdentification.attrs"
t-esc="additionalPartyIdentification.value"
/>
<address>
<city t-if="contact.city" t-esc="contact.city" />
<countryCode t-if="contact.country_id" t-esc="contact.country_id.code" />
<name t-if="contact.name" t-esc="contact.name" />
<postalCode t-if="contact.zip" t-esc="contact.zip" />
<state t-if="contact.state_id" t-esc="contact.state_id.name" />
<streetAddressOne t-if="contact.street" t-esc="contact.street" />
<streetAddressTwo t-if="contact.street2" t-esc="contact.street2" />
</address>
<contact>
<personName t-if="contact.name" t-esc="contact.name" />
<communicationChannel t-if="contact.email">
<communicationChannelCode>EMAIL</communicationChannelCode>
<communicationValue t-esc="contact.email" />
</communicationChannel>
<communicationChannel t-if="contact.phone">
<communicationChannelCode>TELEPHONE</communicationChannelCode>
<communicationValue t-esc="contact.phone" />
</communicationChannel>
</contact>
<organisationDetails t-if="contact.parent_id">
<organisationName t-if="company.name" t-esc="company.name" />
<officialAddress>
<city t-if="company.city" t-esc="company.city" />
<countryCode
t-if="company.country_id"
t-esc="company.country_id.code"
/>
<name t-if="company.name" t-esc="company.name" />
<postalCode t-if="company.zip" t-esc="company.zip" />
<state t-if="company.state_id" t-esc="company.state_id.name" />
<streetAddressOne t-if="company.street" t-esc="company.street" />
<streetAddressTwo t-if="company.street2" t-esc="company.street2" />
</officialAddress>
</organisationDetails>
</template>
</odoo>
11 changes: 11 additions & 0 deletions edi_gs1_oca/data/gs1_backend_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="backend_type_gs1" model="edi.backend.type">
<field name="name">GS1</field>
<field name="code">gs1</field>
</record>
<record id="edi_backend_gs1_default" model="edi.backend">
<field name="name">GS1 default</field>
<field name="backend_type_id" ref="backend_type_gs1" />
</record>
</odoo>
11 changes: 11 additions & 0 deletions edi_gs1_oca/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2021 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


def post_init_hook(env):
"""
Hook used to init automatically some GS1 code on existing UoM
:param env: Odoo Environment
:return:
"""
env["uom.uom"]._execute_gs1_map_code()
7 changes: 7 additions & 0 deletions edi_gs1_oca/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import edi_gs1_xml
from . import edi_gs1_output
from . import edi_gs1_input
from . import edi_gs1_handler
from . import edi_backend
from . import res_partner
from . import uom_uom
21 changes: 21 additions & 0 deletions edi_gs1_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 ACSONE SA
# @author Simone Orsi <simahawk@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class EDIBackend(models.Model):
_inherit = "edi.backend"

# TODO: find another way to configure this w/out polluting edi backend
lsp_partner_id = fields.Many2one(
string="Logistic Services Provider (LSP)",
comodel_name="res.partner",
domain=[("is_lsp", "=", True)],
)
lsc_partner_id = fields.Many2one(
string="Logistic Services Client (LSC)",
comodel_name="res.partner",
default=lambda self: self.env.ref("base.main_partner").id,
)
Loading
Loading