Metadata-Version: 2.1
Name: odoo-addon-edi_queue_oca
Version: 19.0.1.1.0.1
Requires-Dist: odoo-addon-edi_core_oca==19.0.*
Requires-Dist: odoo-addon-queue_job==19.0.*
Requires-Dist: odoo==19.0.*
Summary: Set Queue Jobs on EDI
Home-page: https://github.com/OCA/edi-framework
License: LGPL-3
Author: Dixmit,Camptocamp,Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

=============
Edi Queue Oca
=============

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

.. |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_queue_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_queue_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 integrates EDI exchange records with `Queue
Job <https://github.com/OCA/queue>`__, so that the four core exchange
actions — **generate**, **send**, **receive**, and **process** — are
dispatched as background jobs instead of running synchronously.

Each exchange type can optionally route its jobs to a specific channel,
set a priority, or **hold all jobs until a fixed time of day** — useful
when a trading partner's receiving system has a nightly processing
window or when the operator wants to concentrate resource-intensive EDI
work in off-peak hours.

**Table of contents**

.. contents::
   :local:

Usage
=====

Automatic job dispatch
----------------------

All exchange actions on ``edi.exchange.record`` are dispatched as
background jobs automatically. No per-record configuration is required;
the integration is active for every exchange type as soon as the module
is installed.

Per-type job configuration
--------------------------

Each **Exchange Type** gains a *Queue* tab with optional settings:

+---------------------------+------------------------------------------+
| Field                     | Purpose                                  |
+===========================+==========================================+
| **Job channel**           | Route jobs to a specific channel (e.g.   |
|                           | ``root.edi.high``).                      |
+---------------------------+------------------------------------------+
| **Job priority**          | Integer priority passed to the queue job |
|                           | (lower = higher priority).               |
+---------------------------+------------------------------------------+
| **Enable ETA Scheduling** | Toggle to activate daily job             |
|                           | accumulation (see below).                |
+---------------------------+------------------------------------------+
| **Execution time**        | Hour, minute, and timezone at which      |
|                           | accumulated jobs are released. Visible   |
|                           | only when ETA Scheduling is enabled.     |
+---------------------------+------------------------------------------+

Accumulating jobs until a fixed daily time
------------------------------------------

Enabling **ETA Scheduling** on an exchange type causes every job created
for that type to be **held in the queue** until the configured time of
day, rather than being processed immediately. All jobs that arrive
during the day accumulate and are released together at that moment.

**Typical use cases:**

- A trading partner's receiving system only processes incoming files at
  a specific nightly window (e.g. 22:00).
- Resource-intensive EDI operations (large exports, heavy
  transformations) should be deferred to off-peak hours to avoid
  competing with daytime workloads.
- Operational preference to send a batch of documents at a predictable
  daily time instead of dispatching them one by one in real time.

The execution time is configured with three fields:

- **Hour** — hour of the day (00–23).
- **Minute** — minute of the hour (00–59).
- **Timezone** — the timezone in which the hour and minute are
  interpreted. Defaults to the current user's timezone.

At runtime the configured time is converted to the next matching UTC
datetime and set as the queue job ETA. If the target time for today has
already passed, the job is automatically scheduled for the same time
tomorrow.

When **Enable ETA Scheduling** is off, jobs are dispatched immediately
as usual.

Duplicate-job prevention
------------------------

An identity key is attached to every queued job, so re-triggering an
action for a record that already has a pending job does not enqueue a
duplicate.

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

* Dixmit
* Camptocamp

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

- Simone Orsi <simahawk@gmail.com>
- Enric Tobella <enric.tobella@dixmit.com>
- Manuel Regidor <manuel.regidor@sygel.es>
- Thien Vo <thienvh@trobz.com>
- Jordi Masvidal <jordi.masvidal@forgeflow.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_queue_oca>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
