Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/server-tools (16.0) #1436

Merged
merged 52 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f022064
Migrate and refactore external_file_location
florian-dacosta Jun 24, 2019
945e3f5
- better view layout
GSLabIt Jan 14, 2020
1c2b4b7
- pass pattern to _list
GSLabIt Jan 15, 2020
810aba1
- check for duplicates
GSLabIt Jan 15, 2020
84f3e8d
- use filtered.mapped in place of search
GSLabIt Jan 15, 2020
02a85b6
- fix task view
GSLabIt Jan 17, 2020
31e6089
- fix check_duplicated_files in view
GSLabIt Jan 20, 2020
d910601
Allow to send mail notification if attachment linked to task fail
florian-dacosta Feb 10, 2020
75d7af3
[REF] start cleanning
sebastienbeau May 11, 2020
da74f9a
[REF] refactor code and add test
sebastienbeau May 11, 2020
c616a4a
[REF] run black
sebastienbeau May 11, 2020
f597b71
IMP add button to duplicate task or unactive them, add readme fragments
bealdav Jun 3, 2020
7bd7c02
[FIX] attachment_synchronize: fix tests
clementmbr Jun 22, 2020
adb4a52
[IMP] Add attachment_synchronize_task views
clementmbr Jun 22, 2020
5779a54
[IMP] attachment_synchronize: rename files + add buttonbox task enabled
clementmbr Jul 7, 2020
8146263
[IMP] task run_export + onchange link method_type and file_type if ex…
clementmbr Jul 8, 2020
cacacc9
[IMP] rename check_duplicated_files and improve Task views
clementmbr Jul 9, 2020
eb7de0e
[IMP] task_id readonly if method_type import
clementmbr Jul 8, 2020
46c2629
[IMP] Add smart button to related Tasks from Storage Backend
clementmbr Jul 8, 2020
7699720
[IMP] rename task emails into failure_emails and improve tasks views
clementmbr Jul 9, 2020
d9ee901
[IMP] attachment_queue tree view with tasks
clementmbr Jul 9, 2020
8e12606
[IMP] attachment_ids tree view in Export task
clementmbr Jul 9, 2020
2e4a769
[UPD] attachment_synchronize readme
clementmbr Jul 14, 2020
90f0609
[FIX] duplicate ids in attachment_synchronize_task_views and flake8
clementmbr Jul 14, 2020
ee275d0
[UPD] Add akretion maintainers
clementmbr Aug 27, 2020
005b8f8
FIX attach_synchro: clean demo data
bealdav Aug 27, 2020
d5f00d5
[UPD] Update attachment_synchronize.pot
oca-travis Aug 27, 2020
e8ae332
[UPD] README.rst
OCA-git-bot Aug 27, 2020
ac287fe
[UPD] Update attachment_synchronize.pot
oca-travis Oct 14, 2020
e5c2106
[REF] refactor code, rename enabled to active, and simplifie run code
sebastienbeau Oct 23, 2020
751047e
[IMP] add smart boutton on form view and action button with metric on…
sebastienbeau Oct 23, 2020
c296c71
[REF] make menu more consistent
sebastienbeau Oct 23, 2020
356be64
[UPD] Update attachment_synchronize.pot
oca-travis Dec 10, 2020
e976d63
attachment_synchronize 12.0.2.0.0
OCA-git-bot Dec 10, 2020
3ef953a
[IMP] attachment_synchronize: pre-commit
kevinkhao Mar 4, 2021
ea321d7
[14.0][MIG] attachment_synchronize: migration to 14.0
kevinkhao Mar 4, 2021
7bf4c8a
[IMP] Avoid using deprecated function _list, _delete and replace appr…
kevinkhao Mar 4, 2021
8af87ed
[IMP] improve UI
sebastienbeau Feb 3, 2022
36790b7
[UPD] Update attachment_synchronize.pot
Apr 15, 2022
4b5bffb
[UPD] README.rst
OCA-git-bot Apr 15, 2022
c04cc44
attachment_synchronize 14.0.1.0.1
OCA-git-bot Apr 15, 2022
e863dd0
[14.0][FIX] storage_backend: fix read
sanchonuria Feb 13, 2023
db92364
attachment_synchronize 14.0.1.0.2
OCA-git-bot Feb 14, 2023
a73d811
[IMP] attachment_synchronize: black, isort, prettier
florian-dacosta May 25, 2023
deaa0b8
[MIG] attachment_synchronize : Migration to v16
florian-dacosta May 25, 2023
f81893b
[FIX] make file import work with sshfs + fix import and renaming/movi…
florian-dacosta Dec 27, 2023
97dd5cf
[IMP] remove unnecessary comments
clementmbr Jan 26, 2024
1fb41c2
Merge PR #2632 into 16.0
OCA-git-bot Jan 30, 2024
55d48f2
[UPD] Update attachment_synchronize.pot
Jan 30, 2024
5871564
[UPD] Update base_name_search_improved.pot
Jan 30, 2024
6489ca2
[BOT] post-merge updates
OCA-git-bot Jan 30, 2024
ab1ee57
Update translation files
weblate Jan 30, 2024
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 @@ -22,6 +22,7 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[attachment_queue](attachment_queue/) | 16.0.1.1.0 | [![florian-dacosta](https://github.com/florian-dacosta.png?size=30px)](https://github.com/florian-dacosta) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | Base module adding the concept of queue for processing files
[attachment_synchronize](attachment_synchronize/) | 16.0.1.0.0 | [![florian-dacosta](https://github.com/florian-dacosta.png?size=30px)](https://github.com/florian-dacosta) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) [![GSLabIt](https://github.com/GSLabIt.png?size=30px)](https://github.com/GSLabIt) [![bealdav](https://github.com/bealdav.png?size=30px)](https://github.com/bealdav) | Attachment Synchronize
[attachment_unindex_content](attachment_unindex_content/) | 16.0.1.0.0 | [![moylop260](https://github.com/moylop260.png?size=30px)](https://github.com/moylop260) [![ebirbe](https://github.com/ebirbe.png?size=30px)](https://github.com/ebirbe) [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Disable indexing of attachments
[auditlog](auditlog/) | 16.0.2.0.2 | | Audit Log
[auto_backup](auto_backup/) | 16.0.1.0.0 | | Backups database
Expand Down
129 changes: 129 additions & 0 deletions attachment_synchronize/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
======================
Attachment Synchronize
======================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/16.0/attachment_synchronize
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-attachment_synchronize
: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/server-tools&target_branch=16.0
:alt: Try me on Runboat

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

This module allows to **import/export files** from/to backend servers.

A backend server is defined by the basic `fs_storage <https://github.com/OCA/storage/tree/16.0/fs_storage>`_ OCA module, while it can be configured (amazon S3, sftp,...) with additional modules fs python libraries

The imported files (and the files to be exported) are stored in Odoo as ``attachment.queue`` objects, defined by the `attachment_queue <https://github.com/OCA/server-tools/tree/16.0/attachment_queue>`_ module while the importation itself (resp. exportation) is realized by **"Attachments Import Tasks"** (resp. "Attachments Export Tasks") defined by this current module.

**Table of contents**

.. contents::
:local:

Usage
=====

As importation and exportation are different processes, they are triggered in different ways :

**To import files**, you need to create an *"Attachment Import Task"* (menu *Settings > Technical > Attachments Import Tasks*) which defines :

- where to find the files to import from the backend server (path to the files, selection pattern)
- what to do with the source files in the backend server (avoid duplicates, delete/rename after import...)
- how the files will be processed once imported (through the **File Type** field).

.. image:: https://raw.githubusercontent.com/OCA/server-tools/16.0/attachment_synchronize/static/description/import_task.png

.. epigraph::

🔎 The **File Type** options are defined by other modules built to process the Attachments Queues with the same "File Type".

**To export files**, you need first to register them as *"Attachments Queues"* objects linked to an *"Attachment Export Task"* (which set automatically their **File Type** to *"Export File (External Location)"*).

Then, you can export one file at a time from the *Attachment Queue*'s form view, or export all the *Attachments Queues* in a pending state related to the same *Export Task* from the given *Export Task* form view (menu *Settings > Technical > Attachments Export Tasks*) :

.. image:: https://raw.githubusercontent.com/OCA/server-tools/16.0/attachment_synchronize/static/description/export_task.png

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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/server-tools/issues/new?body=module:%20attachment_synchronize%0Aversion:%2016.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
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

`Akretion <https://www.akretion.com/>`_ :

- Valentin CHEMIERE
- Mourad EL HADJ MIMOUNE <[email protected]>
- Florian DA COSTA <[email protected]>
- Clément MOMBEREAU <[email protected]>

GS Lab:

- Giovanni SERRA <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-florian-dacosta| image:: https://github.com/florian-dacosta.png?size=40px
:target: https://github.com/florian-dacosta
:alt: florian-dacosta
.. |maintainer-sebastienbeau| image:: https://github.com/sebastienbeau.png?size=40px
:target: https://github.com/sebastienbeau
:alt: sebastienbeau
.. |maintainer-GSLabIt| image:: https://github.com/GSLabIt.png?size=40px
:target: https://github.com/GSLabIt
:alt: GSLabIt
.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px
:target: https://github.com/bealdav
:alt: bealdav

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

|maintainer-florian-dacosta| |maintainer-sebastienbeau| |maintainer-GSLabIt| |maintainer-bealdav|

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/16.0/attachment_synchronize>`_ 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 attachment_synchronize/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
28 changes: 28 additions & 0 deletions attachment_synchronize/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# @ 2016 florian DA COSTA @ Akretion
# © 2016 @author Mourad EL HADJ MIMOUNE <[email protected]>
# @ 2020 Giovanni Serra @ GSlab.it
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Attachment Synchronize",
"version": "16.0.1.0.0",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools",
"maintainers": ["florian-dacosta", "sebastienbeau", "GSLabIt", "bealdav"],
"license": "AGPL-3",
"category": "Generic Modules",
"depends": [
"attachment_queue",
"fs_storage", # https://github.com/OCA/storage
],
"data": [
"views/attachment_queue_views.xml",
"views/attachment_synchronize_task_views.xml",
"views/storage_backend_views.xml",
"data/cron.xml",
"security/ir.model.access.csv",
],
"demo": ["demo/attachment_synchronize_task_demo.xml"],
"installable": True,
"development_status": "Beta",
}
16 changes: 16 additions & 0 deletions attachment_synchronize/data/cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">

<record model="ir.cron" id="cronjob_run_attachment_synchronize_task_import">
<field name='name'>Run attachment tasks import</field>
<field name='interval_number'>30</field>
<field name='interval_type'>minutes</field>
<field name="numbercall">-1</field>
<field name="active">False</field>
<field name="doall" eval="False" />
<field name="model_id" ref="model_attachment_synchronize_task" />
<field name="state">code</field>
<field name="code">model.run_task_import_scheduler()</field>
</record>

</odoo>
24 changes: 24 additions & 0 deletions attachment_synchronize/demo/attachment_synchronize_task_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="import_from_filestore" model="attachment.synchronize.task">
<field name="name">TEST Import</field>
<field name="backend_id" ref="fs_storage.default_fs_storage" />
<field name="method_type">import</field>
<field name="after_import">delete</field>
<field name="filepath">test_import</field>
</record>

<record id="export_to_filestore" model="attachment.synchronize.task">
<field name="name">TEST Export</field>
<field name="backend_id" ref="fs_storage.default_fs_storage" />
<field name="method_type">export</field>
<field name="filepath">test_export</field>
</record>

<record id="attachment_queue_imported_demo" model="attachment.queue">
<field name="datas">bWlncmF0aW9uIHRlc3Q=</field>
<field name="name">attachment_queue_imported_demo.doc</field>
<field name="task_id" ref="import_from_filestore" />
</record>

</odoo>
Loading
Loading