diff --git a/.copier-answers.yml b/.copier-answers.yml
index a20b1cc13..19ac99534 100644
--- a/.copier-answers.yml
+++ b/.copier-answers.yml
@@ -1,8 +1,7 @@
# Do NOT update manually; changes here will be overwritten by Copier
-_commit: v1.29
+_commit: v1.40
_src_path: git+https://github.com/OCA/oca-addons-repo-template
additional_ruff_rules: []
-ci: GitHub
convert_readme_fragments_to_markdown: true
enable_checklog_odoo: true
generate_requirements_txt: true
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..e0d56685a
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+test-requirements.txt merge=union
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index 5eb021ef1..1291da527 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -17,6 +17,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
+ cache: 'pip'
+ cache-dependency-path: '.pre-commit-config.yaml'
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v4
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index a06488079..97ed5dfd4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -42,7 +42,7 @@ jobs:
makepot: "true"
services:
postgres:
- image: postgres:12.0
+ image: postgres:12
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
@@ -65,6 +65,13 @@ jobs:
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
+ - name: Upload screenshots from JS tests
+ uses: actions/upload-artifact@v4
+ if: ${{ failure() }}
+ with:
+ name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }}
+ path: /tmp/odoo_tests/${{ env.PGDATABASE }}
+ if-no-files-found: ignore
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0d69703b5..32504883c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -38,12 +38,17 @@ repos:
entry: found a en.po file
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
+ - id: obsolete dotfiles
+ name: obsolete dotfiles
+ entry: found obsolete files; remove them
+ files: '^(\.travis\.yml|\.t2d\.yml|CONTRIBUTING\.md|\.prettierrc\.yml|\.eslintrc\.yml)$'
+ language: fail
- repo: https://github.com/sbidoul/whool
- rev: v1.2
+ rev: v1.3
hooks:
- id: whool-init
- repo: https://github.com/oca/maintainer-tools
- rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded
+ rev: b89f767503be6ab2b11e4f50a7557cb20066e667
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
@@ -95,6 +100,7 @@ repos:
additional_dependencies:
- "eslint@9.12.0"
- "eslint-plugin-jsdoc@50.3.1"
+ - "globals@16.0.0"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
diff --git a/.pylintrc b/.pylintrc
index 7c62b6d2e..197cb6737 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -25,19 +25,25 @@ disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
api-one-multi-together,
- assignment-from-none,
- attribute-deprecated,
class-camelcase,
- dangerous-default-value,
dangerous-view-replace-wo-priority,
- development-status-allowed,
duplicate-id-csv,
- duplicate-key,
duplicate-xml-fields,
duplicate-xml-record-id,
eval-referenced,
- eval-used,
incoherent-interpreter-exec-perm,
+ openerp-exception-warning,
+ redundant-modulename-xml,
+ relative-import,
+ rst-syntax-error,
+ wrong-tabs-instead-of-spaces,
+ xml-syntax-error,
+ assignment-from-none,
+ attribute-deprecated,
+ dangerous-default-value,
+ development-status-allowed,
+ duplicate-key,
+ eval-used,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
@@ -48,73 +54,68 @@ enable=anomalous-backslash-in-string,
method-inverse,
method-required-super,
method-search,
- openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
- redundant-modulename-xml,
reimported,
- relative-import,
return-in-init,
- rst-syntax-error,
sql-injection,
too-few-format-args,
translation-field,
translation-required,
unreachable,
use-vim-comment,
- wrong-tabs-instead-of-spaces,
- xml-syntax-error,
- attribute-string-redundant,
character-not-valid-in-resource-link,
- consider-merging-classes-inherited,
- context-overridden,
create-user-wo-reset-password,
dangerous-filter-wo-user,
dangerous-qweb-replace-wo-priority,
deprecated-data-xml-node,
deprecated-openerp-xml-node,
duplicate-po-message-definition,
- except-pass,
file-not-used,
+ missing-newline-extrafiles,
+ old-api7-method-defined,
+ po-msgstr-variables,
+ po-syntax-error,
+ str-format-used,
+ unnecessary-utf8-coding-comment,
+ xml-attribute-translatable,
+ xml-deprecated-qweb-directive,
+ xml-deprecated-tree-attribute,
+ attribute-string-redundant,
+ consider-merging-classes-inherited,
+ context-overridden,
+ except-pass,
invalid-commit,
manifest-maintainers-list,
- missing-newline-extrafiles,
missing-readme,
missing-return,
odoo-addons-relative-import,
- old-api7-method-defined,
- po-msgstr-variables,
- po-syntax-error,
renamed-field-parameter,
resource-not-exist,
- str-format-used,
test-folder-imported,
translation-contains-variable,
translation-positional-used,
- unnecessary-utf8-coding-comment,
website-manifest-key-not-valid-uri,
- xml-attribute-translatable,
- xml-deprecated-qweb-directive,
- xml-deprecated-tree-attribute,
external-request-timeout,
- # messages that do not cause the lint step to fail
- consider-merging-classes-inherited,
+ missing-manifest-dependency,
+ too-complex,,
create-user-wo-reset-password,
dangerous-filter-wo-user,
- deprecated-module,
file-not-used,
- invalid-commit,
- missing-manifest-dependency,
missing-newline-extrafiles,
- missing-readme,
no-utf8-coding-comment,
- odoo-addons-relative-import,
old-api7-method-defined,
+ unnecessary-utf8-coding-comment,
+ # messages that do not cause the lint step to fail
+ consider-merging-classes-inherited,
+ deprecated-module,
+ invalid-commit,
+ missing-readme,
+ odoo-addons-relative-import,
redefined-builtin,
- too-complex,
- unnecessary-utf8-coding-comment
+ manifest-external-assets
[REPORTS]
diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory
index 018fd61cd..73674c04d 100644
--- a/.pylintrc-mandatory
+++ b/.pylintrc-mandatory
@@ -17,19 +17,25 @@ disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
api-one-multi-together,
- assignment-from-none,
- attribute-deprecated,
class-camelcase,
- dangerous-default-value,
dangerous-view-replace-wo-priority,
- development-status-allowed,
duplicate-id-csv,
- duplicate-key,
duplicate-xml-fields,
duplicate-xml-record-id,
eval-referenced,
- eval-used,
incoherent-interpreter-exec-perm,
+ openerp-exception-warning,
+ redundant-modulename-xml,
+ relative-import,
+ rst-syntax-error,
+ wrong-tabs-instead-of-spaces,
+ xml-syntax-error,
+ assignment-from-none,
+ attribute-deprecated,
+ dangerous-default-value,
+ development-status-allowed,
+ duplicate-key,
+ eval-used,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
@@ -40,56 +46,50 @@ enable=anomalous-backslash-in-string,
method-inverse,
method-required-super,
method-search,
- openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
- redundant-modulename-xml,
reimported,
- relative-import,
return-in-init,
- rst-syntax-error,
sql-injection,
too-few-format-args,
translation-field,
translation-required,
unreachable,
use-vim-comment,
- wrong-tabs-instead-of-spaces,
- xml-syntax-error,
- attribute-string-redundant,
character-not-valid-in-resource-link,
- consider-merging-classes-inherited,
- context-overridden,
create-user-wo-reset-password,
dangerous-filter-wo-user,
dangerous-qweb-replace-wo-priority,
deprecated-data-xml-node,
deprecated-openerp-xml-node,
duplicate-po-message-definition,
- except-pass,
file-not-used,
+ missing-newline-extrafiles,
+ old-api7-method-defined,
+ po-msgstr-variables,
+ po-syntax-error,
+ str-format-used,
+ unnecessary-utf8-coding-comment,
+ xml-attribute-translatable,
+ xml-deprecated-qweb-directive,
+ xml-deprecated-tree-attribute,
+ attribute-string-redundant,
+ consider-merging-classes-inherited,
+ context-overridden,
+ except-pass,
invalid-commit,
manifest-maintainers-list,
- missing-newline-extrafiles,
missing-readme,
missing-return,
odoo-addons-relative-import,
- old-api7-method-defined,
- po-msgstr-variables,
- po-syntax-error,
renamed-field-parameter,
resource-not-exist,
- str-format-used,
test-folder-imported,
translation-contains-variable,
translation-positional-used,
- unnecessary-utf8-coding-comment,
website-manifest-key-not-valid-uri,
- xml-attribute-translatable,
- xml-deprecated-qweb-directive,
- xml-deprecated-tree-attribute,
external-request-timeout
[REPORTS]
diff --git a/README.md b/README.md
index 35b61245d..7b91f650b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
+[](https://odoo-community.org/get-involved?utm_source=repo-readme)
+
+# edi-framework
[](https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&target_branch=18.0)
[](https://github.com/OCA/edi-framework/actions/workflows/pre-commit.yml?query=branch%3A18.0)
[](https://github.com/OCA/edi-framework/actions/workflows/test.yml?query=branch%3A18.0)
@@ -7,8 +10,6 @@
-# edi-framework
-
edi-framework
@@ -23,22 +24,23 @@ addon | version | maintainers | summary
--- | --- | --- | ---
[edi_account_core_oca](edi_account_core_oca/) | 18.0.1.1.1 | | Define EDI Configuration for Account Moves
[edi_account_oca](edi_account_oca/) | 18.0.1.1.1 | | Define some component listeners for Account Moves
-[edi_component_oca](edi_component_oca/) | 18.0.1.0.2 | | Allow to use Connector as a source in EDI
-[edi_core_oca](edi_core_oca/) | 18.0.1.5.6 | | Define backends, exchange types, exchange records, basic automation and views for handling EDI exchanges.
+[edi_component_oca](edi_component_oca/) | 18.0.1.0.3 | | Allow to use Connector as a source in EDI
+[edi_core_oca](edi_core_oca/) | 18.0.1.6.6 | | Define backends, exchange types, exchange records, basic automation and views for handling EDI exchanges.
[edi_endpoint_oca](edi_endpoint_oca/) | 18.0.1.0.3 | | Base module allowing configuration of custom endpoints for EDI framework.
-[edi_exchange_template_oca](edi_exchange_template_oca/) | 18.0.1.3.2 | | Allows definition of exchanges via templates.
+[edi_exchange_template_oca](edi_exchange_template_oca/) | 18.0.1.3.3 | | Allows definition of exchanges via templates.
[edi_exchange_template_party_data](edi_exchange_template_party_data/) | 18.0.1.0.1 | | Glue module between edi_exchange_template and edi_party_data
+[edi_notification_oca](edi_notification_oca/) | 18.0.1.0.0 | | Define notification activities on exchange records.
[edi_oca](edi_oca/) | 18.0.1.5.2 | | Integrate all EDI modules together
[edi_party_data_oca](edi_party_data_oca/) | 18.0.1.0.1 | | Allow to configure and retrieve party information for EDI exchanges.
-[edi_queue_oca](edi_queue_oca/) | 18.0.1.0.1 | | Set Queue Jobs on EDI
-[edi_record_metadata_oca](edi_record_metadata_oca/) | 18.0.1.0.2 | | Allow to store metadata for related records.
+[edi_queue_oca](edi_queue_oca/) | 18.0.1.0.2 | | Set Queue Jobs on EDI
+[edi_record_metadata_oca](edi_record_metadata_oca/) | 18.0.1.0.4 | | Allow to store metadata for related records.
[edi_sale_endpoint](edi_sale_endpoint/) | 18.0.1.0.0 | | Glue module between edi_sale_oca and edi_endpoint_oca.
-[edi_sale_input_oca](edi_sale_input_oca/) | 18.0.1.0.1 | | Process incoming sale orders with the EDI framework.
+[edi_sale_input_oca](edi_sale_input_oca/) | 18.0.1.0.2 | | Process incoming sale orders with the EDI framework.
[edi_sale_oca](edi_sale_oca/) | 18.0.1.0.1 | | Configuration and special behaviors for EDI on sales.
[edi_sale_stock_oca](edi_sale_stock_oca/) | 18.0.1.0.0 | | Configuration and special behaviors for EDI on sales & stock.
[edi_sale_ubl_oca](edi_sale_ubl_oca/) | 18.0.1.0.2 | | Configuration and special behaviors for EDI UBL exchanges related to sales.
[edi_sale_ubl_output_oca](edi_sale_ubl_output_oca/) | 18.0.1.0.1 | | Configuration and special behaviors for EDI on sales.
-[edi_state_oca](edi_state_oca/) | 18.0.1.0.2 | | Allow to assign specific EDI states to related records.
+[edi_state_oca](edi_state_oca/) | 18.0.1.0.3 | | Allow to assign specific EDI states to related records.
[edi_stock_oca](edi_stock_oca/) | 18.0.1.0.1 | | Define EDI Configuration for Stock
[edi_storage_oca](edi_storage_oca/) | 18.0.1.0.2 | | Base module to allow exchanging files via storage backend (eg: SFTP).
[edi_storage_queue_oca](edi_storage_queue_oca/) | 18.0.1.0.0 | | Integrates EDI Storage with Queue
diff --git a/checklog-odoo.cfg b/checklog-odoo.cfg
index 0b55b7bf6..58d43aa66 100644
--- a/checklog-odoo.cfg
+++ b/checklog-odoo.cfg
@@ -1,3 +1,5 @@
[checklog-odoo]
ignore=
WARNING.* 0 failed, 0 error\(s\).*
+ WARNING .* Killing chrome descendants-or-self .*
+ WARNING.* Missing widget: res_partner_many2one for field of type many2one.*
diff --git a/edi_component_oca/README.rst b/edi_component_oca/README.rst
index 8cd40f4f6..db2cffdd7 100644
--- a/edi_component_oca/README.rst
+++ b/edi_component_oca/README.rst
@@ -11,7 +11,7 @@ Edi Connector Oca
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:3bf081843ed5a121210f466d0a354fe495798e66f75d76f6958176548d647356
+ !! source digest: sha256:81c11c0d670f363513d25e5d2d6cb038f1fc56580f20c837c2d2a7665798018d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/edi_component_oca/__manifest__.py b/edi_component_oca/__manifest__.py
index 245d468d5..fa8111718 100644
--- a/edi_component_oca/__manifest__.py
+++ b/edi_component_oca/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Edi Connector Oca",
"summary": """Allow to use Connector as a source in EDI""",
- "version": "18.0.1.0.2",
+ "version": "18.0.1.0.3",
"license": "LGPL-3",
"author": "ACSONE,Dixmit,Camptocamp,Odoo Community Association (OCA)",
"maintainers": ["simahawk", "etobella"],
diff --git a/edi_component_oca/static/description/index.html b/edi_component_oca/static/description/index.html
index b82405afa..e6128b6fa 100644
--- a/edi_component_oca/static/description/index.html
+++ b/edi_component_oca/static/description/index.html
@@ -372,7 +372,7 @@
Edi Connector Oca
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:3bf081843ed5a121210f466d0a354fe495798e66f75d76f6958176548d647356
+!! source digest: sha256:81c11c0d670f363513d25e5d2d6cb038f1fc56580f20c837c2d2a7665798018d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
This module allows to use components to handle code to execute on EDI
diff --git a/edi_component_oca/tests/test_edi_configuration.py b/edi_component_oca/tests/test_edi_configuration.py
index 509b3e2ab..acb9267d9 100644
--- a/edi_component_oca/tests/test_edi_configuration.py
+++ b/edi_component_oca/tests/test_edi_configuration.py
@@ -40,66 +40,64 @@ def setUpClass(cls):
def setUp(self):
super().setUp()
- FakeOutputGenerator.reset_faked()
- FakeOutputSender.reset_faked()
- FakeOutputChecker.reset_faked()
- self.consumer_record = self.env["edi.exchange.consumer.test"].create(
- {
- "name": "Test Consumer",
- "edi_config_ids": [
- (4, self.create_config.id),
- (4, self.write_config.id),
- ],
- }
- )
-
- @classmethod
- def _setup_records(cls): # pylint:disable=missing-return
- super()._setup_records()
- # Load fake models ->/
- cls.loader = FakeModelLoader(cls.env, cls.__module__)
- cls.loader.backup_registry()
+ self.loader = FakeModelLoader(self.env, self.__module__)
+ self.loader.backup_registry()
from odoo.addons.edi_core_oca.tests.fake_models import EdiExchangeConsumerTest
EdiExchangeConsumerTest._edi_config_field_relation = lambda self: self.env[
"edi.configuration"
]
- # We need to override it, as we want to test the usage with components
+ self.loader.update_registry((EdiExchangeConsumerTest,))
- cls.loader.update_registry((EdiExchangeConsumerTest,))
- cls.exchange_type_out.exchange_filename_pattern = "{record.id}"
- cls.edi_configuration = cls.env["edi.configuration"]
- cls.create_config = cls.edi_configuration.create(
+ FakeOutputGenerator.reset_faked()
+ FakeOutputSender.reset_faked()
+ FakeOutputChecker.reset_faked()
+
+ self.create_config = self.env["edi.configuration"].create(
{
"name": "Create Config",
"active": True,
- "backend_id": cls.backend.id,
- "type_id": cls.exchange_type_out.id,
- "trigger_id": cls.env.ref(
+ "backend_id": self.backend.id,
+ "type_id": self.exchange_type_out.id,
+ "trigger_id": self.env.ref(
"edi_core_oca.edi_conf_trigger_record_create"
).id,
- "model_id": cls.env["ir.model"]._get_id("edi.exchange.consumer.test"),
+ "model_id": self.env["ir.model"]._get_id("edi.exchange.consumer.test"),
"snippet_do": "record._edi_send_via_edi(conf.type_id)",
}
)
- cls.write_config = cls.edi_configuration.create(
+ self.write_config = self.env["edi.configuration"].create(
{
"name": "Write Config 1",
"active": True,
- "backend_id": cls.backend.id,
- "type_id": cls.exchange_type_out.id,
- "trigger_id": cls.env.ref(
+ "backend_id": self.backend.id,
+ "type_id": self.exchange_type_out.id,
+ "trigger_id": self.env.ref(
"edi_core_oca.edi_conf_trigger_record_write"
).id,
- "model_id": cls.env["ir.model"]._get_id("edi.exchange.consumer.test"),
+ "model_id": self.env["ir.model"]._get_id("edi.exchange.consumer.test"),
"snippet_do": "record._edi_send_via_edi(conf.type_id)",
}
)
+ self.consumer_record = self.env["edi.exchange.consumer.test"].create(
+ {
+ "name": "Test Consumer",
+ "edi_config_ids": [
+ (4, self.create_config.id),
+ (4, self.write_config.id),
+ ],
+ }
+ )
+
@classmethod
- def tearDownClass(cls):
- cls.loader.restore_registry()
- super().tearDownClass()
+ def _setup_records(cls): # pylint:disable=missing-return
+ super()._setup_records()
+ cls.exchange_type_out.exchange_filename_pattern = "{record.id}"
+
+ def tearDown(self):
+ self.loader.restore_registry()
+ super().tearDown()
def test_edi_send_via_edi_config(self):
# Check configuration on create
diff --git a/edi_core_oca/README.rst b/edi_core_oca/README.rst
index 7b34951d6..bb985bd0d 100644
--- a/edi_core_oca/README.rst
+++ b/edi_core_oca/README.rst
@@ -11,7 +11,7 @@ EDI
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:05f11d491e9ac910591ac4fbb7dc7372d0efb74d2b81b38dd84b58a526739cfc
+ !! source digest: sha256:c609033733302fa71a3c01c11e2729fd2b47ccde0b9a1d0619bed03cc26db4fe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/edi_core_oca/__manifest__.py b/edi_core_oca/__manifest__.py
index 83a9d7452..a2929a7ab 100644
--- a/edi_core_oca/__manifest__.py
+++ b/edi_core_oca/__manifest__.py
@@ -9,7 +9,7 @@
Define backends, exchange types, exchange records,
basic automation and views for handling EDI exchanges.
""",
- "version": "18.0.1.5.6",
+ "version": "18.0.1.6.6",
"website": "https://github.com/OCA/edi-framework",
"development_status": "Beta",
"license": "LGPL-3",
@@ -29,6 +29,8 @@
"data/ir_actions_server.xml",
"data/sequence.xml",
"data/edi_configuration.xml",
+ "data/ir_cron_archive_old_edi_records.xml",
+ "data/ir_cron_delete_old_archived_edi_records.xml",
"security/res_groups.xml",
"security/ir_model_access.xml",
"views/edi_backend_views.xml",
diff --git a/edi_core_oca/data/ir_cron_archive_old_edi_records.xml b/edi_core_oca/data/ir_cron_archive_old_edi_records.xml
new file mode 100644
index 000000000..b1e8dc78d
--- /dev/null
+++ b/edi_core_oca/data/ir_cron_archive_old_edi_records.xml
@@ -0,0 +1,27 @@
+
+
+
+ Archive Old EDI Exchange Records
+
+ code
+
+# Archive old EDI exchange records based on backend configuration
+backends = env['edi.backend'].search([
+ ('auto_archive_records_after_days', '>', 0)
+])
+for backend in backends:
+ cutoff_date = datetime.datetime.now() - datetime.timedelta(days=backend.auto_archive_records_after_days)
+ records = model.search([
+ ('backend_id', '=', backend.id),
+ ('create_date', '<', cutoff_date),
+ ('active', '=', True)
+ ], limit=10000, order="create_date asc")
+ if records:
+ records.action_archive()
+
+ 1
+ days
+
+
+
+
diff --git a/edi_core_oca/data/ir_cron_delete_old_archived_edi_records.xml b/edi_core_oca/data/ir_cron_delete_old_archived_edi_records.xml
new file mode 100644
index 000000000..05d05a111
--- /dev/null
+++ b/edi_core_oca/data/ir_cron_delete_old_archived_edi_records.xml
@@ -0,0 +1,27 @@
+
+
+
+ Delete Old Archived EDI Exchange Records
+
+ code
+
+# Delete old archived EDI exchange records based on backend configuration
+backends = env['edi.backend'].search([
+ ('auto_delete_records_after_days', '>', 0)
+])
+for backend in backends:
+ cutoff_date = datetime.datetime.now() - datetime.timedelta(days=backend.auto_delete_records_after_days)
+ records = model.search([
+ ('backend_id', '=', backend.id),
+ ('create_date', '<', cutoff_date),
+ ('active', '=', False)
+ ], limit=100, order="create_date asc")
+ if records:
+ records.unlink()
+
+ 3
+ hours
+
+
+
+
diff --git a/edi_core_oca/i18n/edi_core_oca.pot b/edi_core_oca/i18n/edi_core_oca.pot
index c77ee2f77..436bf77b7 100644
--- a/edi_core_oca/i18n/edi_core_oca.pot
+++ b/edi_core_oca/i18n/edi_core_oca.pot
@@ -192,10 +192,12 @@ msgstr ""
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration_trigger__active
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type_rule__active
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_search
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_search
msgid "Active"
@@ -240,11 +242,17 @@ msgstr ""
msgid "Apply to this model"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_archive_old_edi_records_ir_actions_server
+msgid "Archive Old EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_trigger_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_form
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_form
@@ -264,6 +272,30 @@ msgid ""
"will take care of generating the output when not set yet. "
msgstr ""
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid "Auto-archive records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid "Auto-delete archived records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid ""
+"Automatically archive EDI exchange records after X days. Set to <= 0 to "
+"disable auto-archiving."
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid ""
+"Automatically delete archived EDI exchange records after X days. Set to <= 0"
+" to disable auto-deletion."
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__backend_id
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__backend_id
@@ -416,6 +448,11 @@ msgstr ""
msgid "Decoding Error Handler"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_delete_old_archived_edi_records_ir_actions_server
+msgid "Delete Old Archived EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration__description
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration_trigger__description
@@ -1364,6 +1401,11 @@ msgstr ""
msgid "Record ID=%d is not meant to be sent!"
msgstr ""
+#. module: edi_core_oca
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
+msgid "Records retention"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_form
msgid "Regenerate"
@@ -1608,7 +1650,8 @@ msgstr ""
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_type__quick_exec
msgid ""
"When active, records of this type will be processed immediately without "
-"waiting for the cron to pass by."
+"waiting for the cron to pass by. Requires auto generate flag to be active as"
+" well. The cron will skip these records unless forced."
msgstr ""
#. module: edi_core_oca
diff --git a/edi_core_oca/i18n/es.po b/edi_core_oca/i18n/es.po
index 36f9a0c0d..6aa91ccbc 100644
--- a/edi_core_oca/i18n/es.po
+++ b/edi_core_oca/i18n/es.po
@@ -196,10 +196,12 @@ msgstr ""
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration_trigger__active
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type_rule__active
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_search
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_search
msgid "Active"
@@ -244,11 +246,17 @@ msgstr ""
msgid "Apply to this model"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_archive_old_edi_records_ir_actions_server
+msgid "Archive Old EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_trigger_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_form
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_form
@@ -268,6 +276,30 @@ msgid ""
"will take care of generating the output when not set yet. "
msgstr ""
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid "Auto-archive records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid "Auto-delete archived records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid ""
+"Automatically archive EDI exchange records after X days. Set to <= 0 to "
+"disable auto-archiving."
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid ""
+"Automatically delete archived EDI exchange records after X days. Set to <= 0 "
+"to disable auto-deletion."
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__backend_id
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__backend_id
@@ -420,6 +452,11 @@ msgstr ""
msgid "Decoding Error Handler"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_delete_old_archived_edi_records_ir_actions_server
+msgid "Delete Old Archived EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration__description
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration_trigger__description
@@ -1373,6 +1410,11 @@ msgstr ""
msgid "Record ID=%d is not meant to be sent!"
msgstr ""
+#. module: edi_core_oca
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
+msgid "Records retention"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_form
msgid "Regenerate"
@@ -1618,7 +1660,8 @@ msgstr ""
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_type__quick_exec
msgid ""
"When active, records of this type will be processed immediately without "
-"waiting for the cron to pass by."
+"waiting for the cron to pass by. Requires auto generate flag to be active as "
+"well. The cron will skip these records unless forced."
msgstr ""
#. module: edi_core_oca
diff --git a/edi_core_oca/i18n/fr.po b/edi_core_oca/i18n/fr.po
index ee73e8c5f..28a967be4 100644
--- a/edi_core_oca/i18n/fr.po
+++ b/edi_core_oca/i18n/fr.po
@@ -201,10 +201,12 @@ msgstr ""
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration_trigger__active
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type_rule__active
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_search
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_search
msgid "Active"
@@ -251,11 +253,17 @@ msgstr ""
msgid "Apply to this model"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_archive_old_edi_records_ir_actions_server
+msgid "Archive Old EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_trigger_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_form
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_form
@@ -278,6 +286,30 @@ msgstr ""
"utile est manquante. Si cette option est active, un cron se chargera de "
"générer la sortie lorsqu'elle n'est pas encore définie. "
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid "Auto-archive records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid "Auto-delete archived records after (days)"
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid ""
+"Automatically archive EDI exchange records after X days. Set to <= 0 to "
+"disable auto-archiving."
+msgstr ""
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid ""
+"Automatically delete archived EDI exchange records after X days. Set to <= 0 "
+"to disable auto-deletion."
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__backend_id
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__backend_id
@@ -430,6 +462,11 @@ msgstr ""
msgid "Decoding Error Handler"
msgstr ""
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_delete_old_archived_edi_records_ir_actions_server
+msgid "Delete Old Archived EDI Exchange Records"
+msgstr ""
+
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration__description
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration_trigger__description
@@ -1391,6 +1428,11 @@ msgstr ""
msgid "Record ID=%d is not meant to be sent!"
msgstr ""
+#. module: edi_core_oca
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
+msgid "Records retention"
+msgstr ""
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_form
msgid "Regenerate"
@@ -1636,7 +1678,8 @@ msgstr ""
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_type__quick_exec
msgid ""
"When active, records of this type will be processed immediately without "
-"waiting for the cron to pass by."
+"waiting for the cron to pass by. Requires auto generate flag to be active as "
+"well. The cron will skip these records unless forced."
msgstr ""
#. module: edi_core_oca
diff --git a/edi_core_oca/i18n/it.po b/edi_core_oca/i18n/it.po
index 0ee1522e0..14ad64c81 100644
--- a/edi_core_oca/i18n/it.po
+++ b/edi_core_oca/i18n/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2025-12-02 15:42+0000\n"
+"PO-Revision-Date: 2026-04-30 10:45+0000\n"
"Last-Translator: mymage \n"
"Language-Team: none\n"
"Language: it\n"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 5.10.4\n"
+"X-Generator: Weblate 5.15.2\n"
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_type__advanced_settings_edit
@@ -259,10 +259,12 @@ msgstr "Riemesso ACK: stato riportato a '%s'"
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration_trigger__active
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type__active
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_type_rule__active
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_search
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_search
msgid "Active"
@@ -309,11 +311,17 @@ msgstr ""
msgid "Apply to this model"
msgstr "Applica a questo modello"
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_archive_old_edi_records_ir_actions_server
+msgid "Archive Old EDI Exchange Records"
+msgstr "Archivia i vecchi record EDI"
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_trigger_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_configuration_view_form
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_form
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_rule_view_search
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_type_view_form
@@ -336,6 +344,34 @@ msgstr ""
"contenuto. Se attiva, un cron gestirà la generazione dell'output quando non "
"ancora impostato. "
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid "Auto-archive records after (days)"
+msgstr "Auto archivia i record dopo (giorni)"
+
+#. module: edi_core_oca
+#: model:ir.model.fields,field_description:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid "Auto-delete archived records after (days)"
+msgstr "Auto cancella i record archiviati dopo (giorni)"
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_archive_records_after_days
+msgid ""
+"Automatically archive EDI exchange records after X days. Set to <= 0 to "
+"disable auto-archiving."
+msgstr ""
+"Archivia automaticamente i record di scambio EDI dopo X giorni. Impostare "
+"inferiore o uguale a 0 per disabilitare l'auto archiviazione."
+
+#. module: edi_core_oca
+#: model:ir.model.fields,help:edi_core_oca.field_edi_backend__auto_delete_records_after_days
+msgid ""
+"Automatically delete archived EDI exchange records after X days. Set to <= 0 "
+"to disable auto-deletion."
+msgstr ""
+"Cancella automaticamente i record di scambio EDI archiviati dopo X giorni. "
+"Impostare inferiore o uguale a 0 per disabilitare l'auto cancellazione."
+
#. module: edi_core_oca
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_configuration__backend_id
#: model:ir.model.fields,field_description:edi_core_oca.field_edi_exchange_record__backend_id
@@ -488,6 +524,11 @@ msgstr "Personalizzato"
msgid "Decoding Error Handler"
msgstr "Gestore errore decodifica"
+#. module: edi_core_oca
+#: model:ir.actions.server,name:edi_core_oca.ir_cron_delete_old_archived_edi_records_ir_actions_server
+msgid "Delete Old Archived EDI Exchange Records"
+msgstr "Cancella i vecchi record di scambio EDI archiviati"
+
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration__description
#: model:ir.model.fields,help:edi_core_oca.field_edi_configuration_trigger__description
@@ -1465,6 +1506,11 @@ msgstr "Record ID=%d non è previsto che sia elaborato"
msgid "Record ID=%d is not meant to be sent!"
msgstr "Record ID=%d non è previsto che sia inviato!"
+#. module: edi_core_oca
+#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_backend_view_form
+msgid "Records retention"
+msgstr "Cancellazione record"
+
#. module: edi_core_oca
#: model_terms:ir.ui.view,arch_db:edi_core_oca.edi_exchange_record_view_form
msgid "Regenerate"
@@ -1721,10 +1767,13 @@ msgstr "Cronologia comunicazioni sito web"
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_type__quick_exec
msgid ""
"When active, records of this type will be processed immediately without "
-"waiting for the cron to pass by."
+"waiting for the cron to pass by. Requires auto generate flag to be active as "
+"well. The cron will skip these records unless forced."
msgstr ""
-"Quando attiva, i record di questo tipo verranno elaborati immediatamente "
-"senza attendere il cron."
+"Quando attivi, i record di questo tipo verranno elaborati immediatamente, "
+"senza attendere il completamento del cron. Richiede che anche il flag di "
+"generazione automatica sia attivo. Il cron ignorerà questi record, a meno "
+"che non venga forzato."
#. module: edi_core_oca
#: model:ir.model.fields,help:edi_core_oca.field_edi_exchange_consumer_mixin__edi_disable_auto
@@ -1746,6 +1795,13 @@ msgstr ""
msgid "error on send"
msgstr "errore nell'invio"
+#~ msgid ""
+#~ "When active, records of this type will be processed immediately without "
+#~ "waiting for the cron to pass by."
+#~ msgstr ""
+#~ "Quando attiva, i record di questo tipo verranno elaborati immediatamente "
+#~ "senza attendere il cron."
+
#~ msgid ""
#~ "For output exchange types this should be a formatting string with the "
#~ "following variables available (to be used between brackets, `{}`): "
diff --git a/edi_core_oca/migrations/18.0.1.6.4/post-mig.py b/edi_core_oca/migrations/18.0.1.6.4/post-mig.py
new file mode 100644
index 000000000..6b52c0399
--- /dev/null
+++ b/edi_core_oca/migrations/18.0.1.6.4/post-mig.py
@@ -0,0 +1,24 @@
+# Copyright 2026 Camptocamp SA (http://www.camptocamp.com)
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+from logging import getLogger
+
+from openupgradelib import openupgrade
+
+_logger = getLogger(__name__)
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ xmlid = "edi_core_oca.rule_edi_exchange_record_user"
+ if rule := env.ref(xmlid, False):
+ old_domain = (rule.domain_force or "").strip()
+ new_domain = ["|", ("model", "!=", False), ("res_id", "=", 0)]
+ _logger.info(
+ f"Updating {rule} ({xmlid=}) domain:\n"
+ f" - old: {old_domain}\n"
+ f" - new: {new_domain}"
+ )
+ rule.domain_force = new_domain
+ else:
+ _logger.warning(f"No rule found with XMLID '{xmlid}', skipping...")
diff --git a/edi_core_oca/models/edi_backend.py b/edi_core_oca/models/edi_backend.py
index bdea2e24f..54c845480 100644
--- a/edi_core_oca/models/edi_backend.py
+++ b/edi_core_oca/models/edi_backend.py
@@ -62,6 +62,18 @@ class EDIBackend(models.Model):
)
active = fields.Boolean(default=True)
company_id = fields.Many2one("res.company", string="Company")
+ auto_archive_records_after_days = fields.Integer(
+ string="Auto-archive records after (days)",
+ default=0,
+ help="Automatically archive EDI exchange records after X days. "
+ "Set to <= 0 to disable auto-archiving.",
+ )
+ auto_delete_records_after_days = fields.Integer(
+ string="Auto-delete archived records after (days)",
+ default=0,
+ help="Automatically delete archived EDI exchange records after X days. "
+ "Set to <= 0 to disable auto-deletion.",
+ )
@property
def exchange_record_model(self):
@@ -373,6 +385,15 @@ def _output_new_records_domain(self, record_ids=None):
]
if record_ids:
domain.append(("id", "in", record_ids))
+ # By default, it's pointless to consider records with quick_exec
+ # because they will be executed right away when created.
+ domain.append(
+ (
+ "type_id.quick_exec",
+ "=",
+ self.env.context.get("edi__quick_exec", False),
+ )
+ )
return domain
def _output_pending_records_domain(self, skip_sent=True, record_ids=None):
@@ -427,6 +448,7 @@ def exchange_process(self, exchange_record):
old_state = state = exchange_record.edi_exchange_state
error = traceback = False
message = None
+ res = None
try:
res = self._exchange_process(exchange_record)
except self._swallable_exceptions() as err:
diff --git a/edi_core_oca/models/edi_exchange_record.py b/edi_core_oca/models/edi_exchange_record.py
index 8e4f697ed..a87b4506e 100644
--- a/edi_core_oca/models/edi_exchange_record.py
+++ b/edi_core_oca/models/edi_exchange_record.py
@@ -113,6 +113,7 @@ class EDIExchangeRecord(models.Model):
parent_id = fields.Many2one(
comodel_name="edi.exchange.record",
help="Original exchange which originated this record",
+ index=True,
)
related_exchange_ids = fields.One2many(
string="Related exchanges",
@@ -133,6 +134,7 @@ class EDIExchangeRecord(models.Model):
help="ACK generated for current exchange.",
compute="_compute_ack_exchange_id",
store=True,
+ index=True,
)
ack_received_on = fields.Datetime(
string="ACK received on", related="ack_exchange_id.exchanged_on"
@@ -142,6 +144,7 @@ class EDIExchangeRecord(models.Model):
help="The record state can be rolled back manually in case of failure.",
)
company_id = fields.Many2one("res.company", string="Company")
+ active = fields.Boolean(default=True)
_sql_constraints = [
("identifier_uniq", "unique(identifier)", "The identifier must be unique."),
@@ -379,10 +382,11 @@ def _execute_next_action(self):
# The backend already knows how to handle records
# according to their direction and status.
# Let it decide.
+ backend = self.backend_id.with_context(edi__quick_exec=True)
if self.type_id.direction == "output":
- self.backend_id._check_output_exchange_sync(record_ids=self.ids)
+ backend._check_output_exchange_sync(record_ids=self.ids)
else:
- self.backend_id._check_input_exchange_sync(record_ids=self.ids)
+ backend._check_input_exchange_sync(record_ids=self.ids)
@api.constrains("backend_id", "type_id")
def _constrain_backend(self):
@@ -635,8 +639,6 @@ def _search(self, domain, offset=0, limit=None, order=None):
extend_ids = list(extend_query)
result.extend(extend_ids[: limit - len(result)])
- # Restore original ordering
- result = [x for x in orig_ids if x in result]
if set(orig_ids) != set(result):
# Create a virgin query
query = self.browse(result)._as_query()
diff --git a/edi_core_oca/models/edi_exchange_type.py b/edi_core_oca/models/edi_exchange_type.py
index 3abe5848f..5850cf356 100644
--- a/edi_core_oca/models/edi_exchange_type.py
+++ b/edi_core_oca/models/edi_exchange_type.py
@@ -155,7 +155,9 @@ class EDIExchangeType(models.Model):
quick_exec = fields.Boolean(
string="Quick execution",
help="When active, records of this type will be processed immediately "
- "without waiting for the cron to pass by.",
+ "without waiting for the cron to pass by. "
+ "Requires auto generate flag to be active as well. "
+ "The cron will skip these records unless forced.",
)
partner_ids = fields.Many2many(
string="Enabled for partners",
diff --git a/edi_core_oca/security/ir_model_access.xml b/edi_core_oca/security/ir_model_access.xml
index 8c85f038b..31c9c73ae 100644
--- a/edi_core_oca/security/ir_model_access.xml
+++ b/edi_core_oca/security/ir_model_access.xml
@@ -122,7 +122,7 @@
['|', ('model','!=', False), ('res_id', '=', False)]
+ >['|', ('model', '!=', False), ('res_id', '=', 0)]
diff --git a/edi_core_oca/static/description/index.html b/edi_core_oca/static/description/index.html
index fa279ca4c..0273741fe 100644
--- a/edi_core_oca/static/description/index.html
+++ b/edi_core_oca/static/description/index.html
@@ -372,7 +372,7 @@
EDI
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:05f11d491e9ac910591ac4fbb7dc7372d0efb74d2b81b38dd84b58a526739cfc
+!! source digest: sha256:c609033733302fa71a3c01c11e2729fd2b47ccde0b9a1d0619bed03cc26db4fe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:ebed0a953bbe9571fc02c722ad850e26c3af87cf9ee52fd7f496048a102717ec
+!! source digest: sha256:c6b98455272323462e208761ef6f68cff26fd2e6f561245ef60fe8af4fe329e8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
Provide EDI exchange templates to control input/output records contents.
diff --git a/edi_exchange_template_oca/tests/test_edi_backend_output.py b/edi_exchange_template_oca/tests/test_edi_backend_output.py
index 89a91bb37..117f170e4 100644
--- a/edi_exchange_template_oca/tests/test_edi_backend_output.py
+++ b/edi_exchange_template_oca/tests/test_edi_backend_output.py
@@ -242,13 +242,21 @@ def test_generate_file(self):
self.assertEqual(file_content.strip(), expected)
def test_prettify(self):
- self.tmpl_out2.template_id.arch = (
+ tmpl_out2 = self.env["edi.exchange.template.output"].browse(self.tmpl_out2.id)
+ record2 = self.env["edi.exchange.record"].browse(self.record2.id)
+ self.assertTrue(
+ tmpl_out2.exists(), "Template output record vanished during test execution"
+ )
+ self.assertTrue(
+ record2.exists(), "Exchange record vanished during test execution"
+ )
+ tmpl_out2.template_id.arch = (
'1'
)
- output = self.tmpl_out2.exchange_generate(self.record2)
+ output = tmpl_out2.exchange_generate(record2)
self.assertEqual(output, b"1")
- self.tmpl_out2.prettify = True
- output = self.tmpl_out2.exchange_generate(self.record2)
+ tmpl_out2.prettify = True
+ output = tmpl_out2.exchange_generate(record2)
self.assertEqual(output, b"\n 1\n\n")
def test_generate_file_report(self):
diff --git a/edi_notification_oca/README.rst b/edi_notification_oca/README.rst
new file mode 100644
index 000000000..3c08c4141
--- /dev/null
+++ b/edi_notification_oca/README.rst
@@ -0,0 +1,97 @@
+.. image:: https://odoo-community.org/readme-banner-image
+ :target: https://odoo-community.org/get-involved?utm_source=readme
+ :alt: Odoo Community Association
+
+================
+EDI Notification
+================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:d865a9ca8287a26c0e9185d73c56951401b600d75381622a3f3474f5ee2c0992
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Alpha
+.. |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/18.0/edi_notification_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-18-0/edi-framework-18-0-edi_notification_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=18.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module creates activities for users when an exchange record's
+process fails.
+
+Exchange types must be configured properly to create such activities:
+
+- field "Notify On Process Error" must be checked to activate the
+ feature for the current exchange type
+- field "Activity Type Used When Notify On Process Error" is used to
+ define the type of the newly created activity
+- fields "Notify Groups On Process Error" and "Notify Users On Process
+ Error" are used to define the users that will be assigned to the newly
+ created activity
+
+.. IMPORTANT::
+ This is an alpha version, the data model and design can change at any time without warning.
+ Only for development or testing purpose, do not use in production.
+ `More details on development status `_
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub 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 `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
+Credits
+=======
+
+Authors
+-------
+
+* Camptocamp
+
+Contributors
+------------
+
+- Duong (Tran Quoc)
+- Simone Orsi
+
+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 `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/edi_notification_oca/__init__.py b/edi_notification_oca/__init__.py
new file mode 100644
index 000000000..f24d3e242
--- /dev/null
+++ b/edi_notification_oca/__init__.py
@@ -0,0 +1,2 @@
+from . import components
+from . import models
diff --git a/edi_notification_oca/__manifest__.py b/edi_notification_oca/__manifest__.py
new file mode 100644
index 000000000..5fc8183f9
--- /dev/null
+++ b/edi_notification_oca/__manifest__.py
@@ -0,0 +1,16 @@
+# Copyright 2024 Camptocamp SA
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+{
+ "name": "EDI Notification",
+ "summary": """Define notification activities on exchange records.""",
+ "version": "18.0.1.0.0",
+ "development_status": "Alpha",
+ "license": "LGPL-3",
+ "website": "https://github.com/OCA/edi-framework",
+ "author": "Camptocamp,Odoo Community Association (OCA)",
+ # TODO v19: consider getting rid off `edi_component_oca` dep
+ "depends": ["edi_core_oca", "edi_component_oca"],
+ "data": ["data/mail_activity_type.xml", "views/edi_exchange_type.xml"],
+ "installable": True,
+}
diff --git a/edi_notification_oca/components/__init__.py b/edi_notification_oca/components/__init__.py
new file mode 100644
index 000000000..9430369c2
--- /dev/null
+++ b/edi_notification_oca/components/__init__.py
@@ -0,0 +1 @@
+from . import listener
diff --git a/edi_notification_oca/components/listener.py b/edi_notification_oca/components/listener.py
new file mode 100644
index 000000000..30945e128
--- /dev/null
+++ b/edi_notification_oca/components/listener.py
@@ -0,0 +1,44 @@
+# Copyright 2024 Camptocamp SA
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+from odoo.addons.component.core import Component
+
+
+class EdiNotificationListener(Component):
+ _name = "edi.notification.component.listener"
+ _inherit = "base.event.listener"
+
+ def on_edi_exchange_error(self, record):
+ exc_type = record.type_id
+ notify_on_process_error = exc_type.notify_on_process_error
+ activity_type = exc_type.notify_on_process_error_activity_type_id
+ if (
+ not notify_on_process_error
+ or not activity_type
+ or not (
+ exc_type.notify_on_process_error_groups_ids
+ or exc_type.notify_on_process_error_users_ids
+ )
+ ):
+ return True
+ users = self._get_users_to_notify(exc_type)
+ # Send notification to defined users
+ for user in users:
+ record.activity_schedule(
+ activity_type_id=activity_type.id,
+ summary=self.env._(
+ "EDI: Process error on record '%(identifier)s'.",
+ identifier=record.identifier,
+ ),
+ note=record.exchange_error,
+ user_id=user.id,
+ automated=True,
+ )
+ return True
+
+ def _get_users_to_notify(self, exc_type):
+ exc_type.ensure_one()
+ return (
+ exc_type.notify_on_process_error_groups_ids.users
+ | exc_type.notify_on_process_error_users_ids
+ )
diff --git a/edi_notification_oca/data/mail_activity_type.xml b/edi_notification_oca/data/mail_activity_type.xml
new file mode 100644
index 000000000..7fa92c0d4
--- /dev/null
+++ b/edi_notification_oca/data/mail_activity_type.xml
@@ -0,0 +1,12 @@
+
+
+
+ EDI Exchange Record: Failed
+ fa-warning
+ edi.exchange.record
+ warning
+
+
diff --git a/edi_notification_oca/i18n/edi_notification_oca.pot b/edi_notification_oca/i18n/edi_notification_oca.pot
new file mode 100644
index 000000000..f31e62e4a
--- /dev/null
+++ b/edi_notification_oca/i18n/edi_notification_oca.pot
@@ -0,0 +1,149 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * edi_notification_oca
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 18.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_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_ids
+msgid "Activities"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_exception_decoration
+msgid "Activity Exception Decoration"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_state
+msgid "Activity State"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_type_icon
+msgid "Activity Type Icon"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_activity_type_id
+msgid "Activity Type Used When Notify On Process Error"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:mail.activity.type,name:edi_notification_oca.mail_activity_failed_exchange_record_warning
+msgid "EDI Exchange Record: Failed"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model,name:edi_notification_oca.model_edi_exchange_type
+msgid "EDI Exchange Type"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model,name:edi_notification_oca.model_edi_exchange_record
+msgid "EDI exchange Record"
+msgstr ""
+
+#. module: edi_notification_oca
+#. odoo-python
+#: code:addons/edi_notification_oca/components/listener.py:0
+msgid "EDI: Process error on record '%(identifier)s'."
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_type_icon
+msgid "Font awesome icon e.g. fa-tasks"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_exception_icon
+msgid "Icon"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_exception_icon
+msgid "Icon to indicate an exception activity."
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_type__notify_on_process_error
+msgid ""
+"If an error happens on process, a notification will be sent to all selected "
+"users. If active, please select the specific groups and specific users in "
+"the 'Notifications' page."
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__my_activity_date_deadline
+msgid "My Activity Deadline"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_date_deadline
+msgid "Next Activity Deadline"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_summary
+msgid "Next Activity Summary"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_type_id
+msgid "Next Activity Type"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model_terms:ir.ui.view,arch_db:edi_notification_oca.edi_exchange_type_view_form
+msgid "Notification"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_groups_ids
+msgid "Notify Groups On Process Error"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error
+msgid "Notify On Process Error"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_users_ids
+msgid "Notify Users On Process Error"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_user_id
+msgid "Responsible User"
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_users_ids
+msgid ""
+"Select users to send notifications to. If 'Notification Groups' have been "
+"selected, notifications will also be sent to users selected in here."
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_state
+msgid ""
+"Status based on activities\n"
+"Overdue: Due date is already passed\n"
+"Today: Activity date is today\n"
+"Planned: Future activities."
+msgstr ""
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_exception_decoration
+msgid "Type of the exception activity on record."
+msgstr ""
diff --git a/edi_notification_oca/i18n/it.po b/edi_notification_oca/i18n/it.po
new file mode 100644
index 000000000..5a02a680f
--- /dev/null
+++ b/edi_notification_oca/i18n/it.po
@@ -0,0 +1,163 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * edi_notification_oca
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 16.0\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: 2024-09-10 14:06+0000\n"
+"Last-Translator: mymage \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_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_ids
+msgid "Activities"
+msgstr "Attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_exception_decoration
+msgid "Activity Exception Decoration"
+msgstr "Decorazione eccezione attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_state
+msgid "Activity State"
+msgstr "Stato attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_type_icon
+msgid "Activity Type Icon"
+msgstr "Icona tipo attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_activity_type_id
+msgid "Activity Type Used When Notify On Process Error"
+msgstr "Tipo attività utilizzata nelle notifiche di errori di processo"
+
+#. module: edi_notification_oca
+#: model:mail.activity.type,name:edi_notification_oca.mail_activity_failed_exchange_record_warning
+msgid "EDI Exchange Record: Failed"
+msgstr "Record scambio EDI: fallito"
+
+#. module: edi_notification_oca
+#: model:ir.model,name:edi_notification_oca.model_edi_exchange_type
+msgid "EDI Exchange Type"
+msgstr "Tipo scambio EDI"
+
+#. module: edi_notification_oca
+#: model:ir.model,name:edi_notification_oca.model_edi_exchange_record
+msgid "EDI exchange Record"
+msgstr "Record di scambio EDI"
+
+#. module: edi_notification_oca
+#. odoo-python
+#: code:addons/edi_notification_oca/components/listener.py:0
+#, python-format
+msgid "EDI: Process error on record '%(identifier)s'."
+msgstr "EDI: errore di processo nel record '%(identifier)s'."
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_type_icon
+msgid "Font awesome icon e.g. fa-tasks"
+msgstr "Icona Font Awesome es. fa-tasks"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_exception_icon
+msgid "Icon"
+msgstr "Icona"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_exception_icon
+msgid "Icon to indicate an exception activity."
+msgstr "Icona per indicare un'attività eccezione."
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_type__notify_on_process_error
+msgid ""
+"If an error happens on process, a notification will be sent to all selected "
+"users. If active, please select the specific groups and specific users in "
+"the 'Notifications' page."
+msgstr ""
+"Se si verifica un errore durante il processo, verrà inviata una notifica a "
+"tutti gli utenti selezionati. Se attiva, selezionare i gruppi e gli utenti "
+"specifici nella pagina \"Notifiche\"."
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__my_activity_date_deadline
+msgid "My Activity Deadline"
+msgstr "Scadenza mia attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_date_deadline
+msgid "Next Activity Deadline"
+msgstr "Scadenza prossima attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_summary
+msgid "Next Activity Summary"
+msgstr "Riepilogo prossima attività"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_type_id
+msgid "Next Activity Type"
+msgstr "Tipo prossima attività"
+
+#. module: edi_notification_oca
+#: model_terms:ir.ui.view,arch_db:edi_notification_oca.edi_exchange_type_view_form
+msgid "Notification"
+msgstr "Notifica"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_groups_ids
+msgid "Notify Groups On Process Error"
+msgstr "Avvisa i gruppi all'errore di processo"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error
+msgid "Notify On Process Error"
+msgstr "Avvisa all'errore di processo"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_users_ids
+msgid "Notify Users On Process Error"
+msgstr "Avvisa gli utenti all'errore di processo"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,field_description:edi_notification_oca.field_edi_exchange_record__activity_user_id
+msgid "Responsible User"
+msgstr "Utente responsabile"
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_type__notify_on_process_error_users_ids
+msgid ""
+"Select users to send notifications to. If 'Notification Groups' have been "
+"selected, notifications will also be sent to users selected in here."
+msgstr ""
+"Seleziona gli utenti a cui inviare le notifiche. Se sono stati selezionati "
+"'Gruppi di notifica', le notifiche saranno inviate anche agli utenti "
+"selezionati qui."
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_state
+msgid ""
+"Status based on activities\n"
+"Overdue: Due date is already passed\n"
+"Today: Activity date is today\n"
+"Planned: Future activities."
+msgstr ""
+"Stato in base alle attività\n"
+"Scaduto: la data richiesta è trascorsa\n"
+"Oggi: la data attività è oggi\n"
+"Pianificato: attività future."
+
+#. module: edi_notification_oca
+#: model:ir.model.fields,help:edi_notification_oca.field_edi_exchange_record__activity_exception_decoration
+msgid "Type of the exception activity on record."
+msgstr "Tipo di attività eccezione sul record."
diff --git a/edi_notification_oca/models/__init__.py b/edi_notification_oca/models/__init__.py
new file mode 100644
index 000000000..6128f744d
--- /dev/null
+++ b/edi_notification_oca/models/__init__.py
@@ -0,0 +1,2 @@
+from . import edi_exchange_type
+from . import edi_exchange_record
diff --git a/edi_notification_oca/models/edi_exchange_record.py b/edi_notification_oca/models/edi_exchange_record.py
new file mode 100644
index 000000000..e6b48bc68
--- /dev/null
+++ b/edi_notification_oca/models/edi_exchange_record.py
@@ -0,0 +1,9 @@
+# Copyright 2024 Camptocamp SA
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+from odoo import models
+
+
+class EDIExchangeRecord(models.Model):
+ _name = "edi.exchange.record"
+ _inherit = ["edi.exchange.record", "mail.activity.mixin"]
diff --git a/edi_notification_oca/models/edi_exchange_type.py b/edi_notification_oca/models/edi_exchange_type.py
new file mode 100644
index 000000000..3f29d606e
--- /dev/null
+++ b/edi_notification_oca/models/edi_exchange_type.py
@@ -0,0 +1,52 @@
+# Copyright 2024 Camptocamp SA
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+from odoo import api, fields, models
+
+
+class EDIExchangeType(models.Model):
+ _inherit = "edi.exchange.type"
+
+ notify_on_process_error = fields.Boolean(
+ help="If an error happens on process, a notification will be sent to all"
+ " selected users. If active, please select the specific groups and"
+ " specific users in the 'Notifications' page.",
+ default=False,
+ )
+ notify_on_process_error_groups_ids = fields.Many2many(
+ comodel_name="res.groups",
+ string="Notify Groups On Process Error",
+ inverse="_inverse_notify_on_process_error_groups_users",
+ )
+ notify_on_process_error_users_ids = fields.Many2many(
+ comodel_name="res.users",
+ string="Notify Users On Process Error",
+ inverse="_inverse_notify_on_process_error_groups_users",
+ help="Select users to send notifications to."
+ " If 'Notification Groups' have been selected, notifications will also be sent"
+ " to users selected in here.",
+ )
+ notify_on_process_error_activity_type_id = fields.Many2one(
+ "mail.activity.type",
+ string="Activity Type Used When Notify On Process Error",
+ default=lambda self: self._default_notify_on_process_error_activity_type_id(),
+ )
+
+ def _default_notify_on_process_error_activity_type_id(self):
+ return self.env.ref(
+ "edi_notification_oca.mail_activity_failed_exchange_record_warning", False
+ )
+
+ @api.onchange("notify_on_process_error")
+ def _onchange_notify_on_process_error(self):
+ if not self.notify_on_process_error:
+ self.notify_on_process_error_groups_ids = None
+ self.notify_on_process_error_users_ids = None
+
+ def _inverse_notify_on_process_error_groups_users(self):
+ for rec in self:
+ if (
+ rec.notify_on_process_error_groups_ids
+ or rec.notify_on_process_error_users_ids
+ ):
+ rec.notify_on_process_error = True
diff --git a/edi_notification_oca/pyproject.toml b/edi_notification_oca/pyproject.toml
new file mode 100644
index 000000000..4231d0ccc
--- /dev/null
+++ b/edi_notification_oca/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/edi_notification_oca/readme/CONTRIBUTORS.md b/edi_notification_oca/readme/CONTRIBUTORS.md
new file mode 100644
index 000000000..289708028
--- /dev/null
+++ b/edi_notification_oca/readme/CONTRIBUTORS.md
@@ -0,0 +1,2 @@
+- Duong (Tran Quoc) \<\>
+- Simone Orsi \<\>
diff --git a/edi_notification_oca/readme/DESCRIPTION.md b/edi_notification_oca/readme/DESCRIPTION.md
new file mode 100644
index 000000000..3f250b798
--- /dev/null
+++ b/edi_notification_oca/readme/DESCRIPTION.md
@@ -0,0 +1,10 @@
+This module creates activities for users when an exchange record's process fails.
+
+Exchange types must be configured properly to create such activities:
+
+- field "Notify On Process Error" must be checked to activate the feature
+ for the current exchange type
+- field "Activity Type Used When Notify On Process Error" is used to define
+ the type of the newly created activity
+- fields "Notify Groups On Process Error" and "Notify Users On Process Error" are used
+ to define the users that will be assigned to the newly created activity
diff --git a/edi_notification_oca/static/description/icon.png b/edi_notification_oca/static/description/icon.png
new file mode 100644
index 000000000..3a0328b51
Binary files /dev/null and b/edi_notification_oca/static/description/icon.png differ
diff --git a/edi_notification_oca/static/description/index.html b/edi_notification_oca/static/description/index.html
new file mode 100644
index 000000000..cbf2538dc
--- /dev/null
+++ b/edi_notification_oca/static/description/index.html
@@ -0,0 +1,447 @@
+
+
+
+
+
+README.rst
+
+
+
+
This module creates activities for users when an exchange record’s
+process fails.
+
Exchange types must be configured properly to create such activities:
+
+
field “Notify On Process Error” must be checked to activate the
+feature for the current exchange type
+
field “Activity Type Used When Notify On Process Error” is used to
+define the type of the newly created activity
+
fields “Notify Groups On Process Error” and “Notify Users On Process
+Error” are used to define the users that will be assigned to the newly
+created activity
+
+
+
Important
+
This is an alpha version, the data model and design can change at any time without warning.
+Only for development or testing purpose, do not use in production.
+More details on development status
Bugs are tracked on GitHub 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.
+
Do not contact contributors directly about support or help with technical issues.
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 file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:e3afeef7814c93bbb02342bbea9a025fdac06fcbf906dcc4eb2b221aa4757a1e
+!! source digest: sha256:273ae337ce810a27ea20810513190a340066e443fdb5d1b3d00065665bf8c6aa
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:1458f5d439bfde955a3c1dc00e8c8ab99b674d8bdb518b9bfe6e475df80742a6
+!! source digest: sha256:031a6af4aecc4f3f856b85d4d793f21481e7f45e181875c59435bf59e17b3239
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:b94605243de3a33cc1d60443e16739b5e3c1a135859aab0b21154ff1173e1f0a
+!! source digest: sha256:e8a144d5155e42c0155d565988d9fecd87ed66b45db2090a072b8829eab6ab34
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->