Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ addon | version | maintainers | summary
[edi_component_oca](edi_component_oca/) | 19.0.1.1.0 | <a href='https://github.com/simahawk'><img src='https://github.com/simahawk.png' width='32' height='32' style='border-radius:50%;' alt='simahawk'/></a> <a href='https://github.com/etobella'><img src='https://github.com/etobella.png' width='32' height='32' style='border-radius:50%;' alt='etobella'/></a> | Allow to use Connector as a source in EDI
[edi_core_oca](edi_core_oca/) | 19.0.1.2.2 | <a href='https://github.com/simahawk'><img src='https://github.com/simahawk.png' width='32' height='32' style='border-radius:50%;' alt='simahawk'/></a> <a href='https://github.com/etobella'><img src='https://github.com/etobella.png' width='32' height='32' style='border-radius:50%;' alt='etobella'/></a> | Define backends, exchange types, exchange records, basic automation and views for handling EDI exchanges.
[edi_endpoint_oca](edi_endpoint_oca/) | 19.0.1.1.1 | | Base module allowing configuration of custom endpoints for EDI framework.
[edi_exchange_deduplicate_oca](edi_exchange_deduplicate_oca/) | 19.0.1.1.0 | <a href='https://github.com/simahawk'><img src='https://github.com/simahawk.png' width='32' height='32' style='border-radius:50%;' alt='simahawk'/></a> <a href='https://github.com/etobella'><img src='https://github.com/etobella.png' width='32' height='32' style='border-radius:50%;' alt='etobella'/></a> | Introduce a deduplication mechanism at the sending step
[edi_product_oca](edi_product_oca/) | 19.0.1.0.0 | | EDI framework configuration and base logic for products and units of measure
[edi_purchase_oca](edi_purchase_oca/) | 19.0.1.0.0 | | Define EDI Configuration for Purchase Orders
[edi_queue_oca](edi_queue_oca/) | 19.0.1.0.0 | | Set Queue Jobs on EDI
Expand Down
126 changes: 126 additions & 0 deletions edi_exchange_deduplicate_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============================
Edi Exchange Deduplicate OCA
============================

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

.. |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-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--framework-lightgray.png?logo=github
:target: https://github.com/OCA/edi-framework/tree/19.0/edi_exchange_deduplicate_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_exchange_deduplicate_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 module adds options for deduplication records before sending step
on type:

- deduplicate_on_send: check if a fresher one does not exist for the
same record. If so, mark the oldest one as obsolete.
- delete_obsolete_records: Delete records marked as obsolete.

**Table of contents**

.. contents::
:local:

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

Go to "EDI -> Config -> Exchange Type".

Enable "Deduplicate on Send" option -> Enable "Delete obsolete records"
option.

Usage
=====

With all the types that have been enabled "Deduplicate on Send" option,
this module will check their records if a fresher one does not exist for
the same record. If so, mark the oldest one as obsolete (except
"block_obsolescence" records)

- "block_obsolescence" is an technical option on records to avoid
marking them as obsolete.
- You can restrict deduplication to specific exchange states with the
technical field "deduplicate_on_exchange_record_status"
(comma-separated values from "edi_exchange_state").

With all the types that have been enabled "Delete obsolete records"
option, the cron will remove their obsolete records.

- If the records are obsolete, delete them even if their type's flag has
been disabled.

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_exchange_deduplicate_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
-------

* Camptocamp

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

- Simone Orsi <simone.orsi@camptocamp.com>
- Duong (Tran Quoc) <duongtq@trobz.com>
- Hadrien Huvelle <hadrien.huvelle@camptocamp.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.

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

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

|maintainer-simahawk| |maintainer-etobella|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions edi_exchange_deduplicate_oca/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions edi_exchange_deduplicate_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Camptocamp
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Edi Exchange Deduplicate OCA",
"summary": """
Introduce a deduplication mechanism at the sending step""",
"version": "19.0.1.1.0",
"license": "LGPL-3",
"author": "Camptocamp,Odoo Community Association (OCA)",
"maintainers": ["simahawk", "etobella"],
"website": "https://github.com/OCA/edi-framework",
"depends": ["edi_core_oca"],
"data": [
"data/cron.xml",
"views/edi_exchange_type_views.xml",
],
"demo": [],
}
17 changes: 17 additions & 0 deletions edi_exchange_deduplicate_oca/data/cron.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="cron_edi_backend_delete_obsolete_records"
model="ir.cron"
forcecreate="True"
>
<field name="name">EDI exchange delete obsolete records</field>
<field name="active" eval="True" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="model_id" ref="edi_core_oca.model_edi_backend" />
<field name="state">code</field>
<field name="code">model.search([])._cron_delete_obsolete_records()</field>
</record>
</odoo>
103 changes: 103 additions & 0 deletions edi_exchange_deduplicate_oca/i18n/edi_exchange_deduplicate_oca.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * edi_exchange_deduplicate_oca
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.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_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_type__deduplicate_on_send
msgid ""
"Before sending an exchange record, check if a fresher one does not exist for"
" same record; if so, mark oldest one as obsolete."
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__block_obsolescence
msgid "Block Obsolescence"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__deduplicate_on_exchange_record_status
msgid "Deduplicate On Exchange Record Status"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__deduplicate_on_send
msgid "Deduplicate on Send"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__delete_obsolete_records
msgid "Delete obsolete records"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_type__delete_obsolete_records
msgid "Delete records marked as obsolete."
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_backend__display_name
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__display_name
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__display_name
msgid "Display Name"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_backend
msgid "EDI Backend"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_exchange_type
msgid "EDI Exchange Type"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_exchange_record
msgid "EDI exchange Record"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.actions.server,name:edi_exchange_deduplicate_oca.cron_edi_backend_delete_obsolete_records_ir_actions_server
msgid "EDI exchange delete obsolete records"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__edi_exchange_state
msgid "Exchange state"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_record__block_obsolescence
msgid "Flag record that can never be marked as obsolete"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_backend__id
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__id
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__id
msgid "ID"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#. odoo-python
#: code:addons/edi_exchange_deduplicate_oca/models/edi_exchange_type.py:0
msgid ""
"Invalid exchange state(s): %(invalid_states)s. Allowed values are: "
"%(allowed_states)s"
msgstr ""

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields.selection,name:edi_exchange_deduplicate_oca.selection__edi_exchange_record__edi_exchange_state__obsolete
msgid "Obsolete"
msgstr ""
82 changes: 82 additions & 0 deletions edi_exchange_deduplicate_oca/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * edi_exchange_deduplicate_oca
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-07 17:58+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_type__deduplicate_on_send
msgid ""
"Before sending an exchange record, check if a fresher one does not exist for"
" same record; if so, mark oldest one as obsolete."
msgstr ""
"Prima di inviare un record di scambio, controlla se ne esiste uno più "
"recente per lo stesso record; se così, marca il vecchio come obsoleto."

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__block_obsolescence
msgid "Block Obsolescence"
msgstr "Obsolescenza blocco"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__deduplicate_on_send
msgid "Deduplicate on Send"
msgstr "Duplica alla spedizione"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_type__delete_obsolete_records
msgid "Delete obsolete records"
msgstr "Cancella record obsoleti"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_type__delete_obsolete_records
msgid "Delete records marked as obsolete."
msgstr "Cancella record marcati come obsoleti."

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_backend
msgid "EDI Backend"
msgstr "Backend EDI"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_exchange_type
msgid "EDI Exchange Type"
msgstr "Tipo scambio EDI"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model,name:edi_exchange_deduplicate_oca.model_edi_exchange_record
msgid "EDI exchange Record"
msgstr "Record di scambio EDI"

#. module: edi_exchange_deduplicate_oca
#: model:ir.actions.server,name:edi_exchange_deduplicate_oca.cron_edi_backend_delete_obsolete_records_ir_actions_server
#: model:ir.cron,cron_name:edi_exchange_deduplicate_oca.cron_edi_backend_delete_obsolete_records
msgid "EDI exchange delete obsolete records"
msgstr "Scambio EDI cancella record obsoleti"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,field_description:edi_exchange_deduplicate_oca.field_edi_exchange_record__edi_exchange_state
msgid "Exchange state"
msgstr "Stato scambio"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields,help:edi_exchange_deduplicate_oca.field_edi_exchange_record__block_obsolescence
msgid "Flag record that can never be marked as obsolete"
msgstr "Segna record che non devono mai essere marcati obsoleti"

#. module: edi_exchange_deduplicate_oca
#: model:ir.model.fields.selection,name:edi_exchange_deduplicate_oca.selection__edi_exchange_record__edi_exchange_state__obsolete
msgid "Obsolete"
msgstr "Obsoleto"
3 changes: 3 additions & 0 deletions edi_exchange_deduplicate_oca/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import edi_backend
from . import edi_exchange_type
from . import edi_exchange_record
Loading
Loading