Browse Source

[UPD] attachment_synchronize readme

12.0-mig-module_prototyper_last
clementmbr 4 years ago
committed by David Beal
parent
commit
d6d0e9bd62
  1. 64
      attachment_synchronize/README.rst
  2. 5
      attachment_synchronize/__manifest__.py
  3. 15
      attachment_synchronize/models/attachment_synchronize_task.py
  4. 15
      attachment_synchronize/readme/CONFIGURE.rst
  5. 1
      attachment_synchronize/readme/CONTRIBUTORS.rst
  6. 7
      attachment_synchronize/readme/DESCRIPTION.rst
  7. 19
      attachment_synchronize/readme/USAGE.rst
  8. BIN
      attachment_synchronize/static/description/export_task.png
  9. BIN
      attachment_synchronize/static/description/file.png
  10. BIN
      attachment_synchronize/static/description/import_task.png
  11. 53
      attachment_synchronize/static/description/index.html
  12. BIN
      attachment_synchronize/static/description/sftp.png

64
attachment_synchronize/README.rst

@ -13,50 +13,59 @@ Attachment Synchronize
.. |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-akretion%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/akretion/server-tools/tree/12-mig-external_file_location/attachment_synchronize
:alt: akretion/server-tools
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/12.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-12-0/server-tools-12-0-attachment_synchronize
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3|
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allow you to deal with remote communication to import/export files.
It allow to store paths and settings from/to remote servers.
This module allows to **import/export files** from/to backend servers.
It depends of attachment_queue to store attachments
A backend server is defined by the basic `storage_backend <https://github.com/OCA/storage/tree/12.0/storage_backend>`_ OCA module, while it can be configured (amazon S3, sftp,...) with additional modules from the `storage <https://github.com/oca/storage>`_ repository.
With additional modules coming from https://github.com/storage you can use ftp, sftp, etc
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/12.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:
Configuration
=============
Usage
=====
To use this module, you need to:
As importation and exportation are different processes, they are triggered in different ways :
* Add a location with your server infos
* Create a task with your file info and remote communication method
* A cron task will trigger each task
**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).
.. figure:: https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/file.png
.. image:: https://raw.githubusercontent.com/OCA/server-tools/12.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".
.. figure:: https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/sftp.png
**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*) :
With the help of storage_backend_sftp
.. image:: https://raw.githubusercontent.com/OCA/server-tools/12.0/attachment_synchronize/static/description/export_task.png
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/akretion/server-tools/issues>`_.
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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/akretion/server-tools/issues/new?body=module:%20attachment_synchronize%0Aversion:%2012-mig-external_file_location%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20attachment_synchronize%0Aversion:%2012.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.
@ -76,6 +85,7 @@ Contributors
- Valentin CHEMIERE
- Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
- Florian DA COSTA <florian.dacosta@akretion.com>
- Clément MOMBEREAU <clement.mombereau@akretion.com.br>
GS Lab:
@ -84,6 +94,16 @@ GS Lab:
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
@ -94,10 +114,10 @@ Maintainers
:target: https://github.com/bealdav
:alt: bealdav
Current maintainers:
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-florian-dacosta| |maintainer-GSLabIt| |maintainer-bealdav|
This module is part of the `akretion/server-tools <https://github.com/akretion/server-tools/tree/12-mig-external_file_location/attachment_synchronize>`_ project on GitHub.
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/12.0/attachment_synchronize>`_ project on GitHub.
You are welcome to contribute.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

5
attachment_synchronize/__manifest__.py

@ -10,7 +10,10 @@
"website": "https://github.com/oca/server-tools",
"license": "AGPL-3",
"category": "Generic Modules",
"depends": ["attachment_queue", "storage_backend"],
"depends": [
"attachment_queue",
"storage_backend", # https://github.com/OCA/storage
],
"data": [
"views/attachment_queue_views.xml",
"views/attachment_synchronize_task_views.xml",

15
attachment_synchronize/models/attachment_synchronize_task.py

@ -55,7 +55,9 @@ class AttachmentSynchronizeTask(models.Model):
)
pattern = fields.Char(
string="Selection Pattern",
help="Used to select the files to be imported. If empty, import all the files.",
help="Pattern used to select the files to be imported following the 'fnmatch' "
"special characters (e.g. '*.txt' to catch all the text files).\n"
"If empty, import all the files found in 'File Path'.",
)
filepath = fields.Char(
string="File Path", help="Path to imported/exported files in the Backend"
@ -67,10 +69,9 @@ class AttachmentSynchronizeTask(models.Model):
)
new_name = fields.Char(
string="New Name",
help="Imported File will be renamed to this name\n"
"Name can use mako template where obj is an "
"ir_attachement. template exemple : "
" ${obj.name}-${obj.create_date}.csv",
help="Imported File will be renamed to this name.\n"
"New Name can use 'mako' template where 'obj' is the original file's name.\n"
"For instance : ${obj.name}-${obj.create_date}.csv",
)
after_import = fields.Selection(
selection=[
@ -95,8 +96,8 @@ class AttachmentSynchronizeTask(models.Model):
)
failure_emails = fields.Char(
string="Failure Emails",
help="Used to fill the field 'Failure Emails' in the task related "
"Attachments Queues.\nThese emails will be notified if any operation on these "
help="Used to fill the 'Failure Emails' fields in the 'Attachments Queues' "
"related to this task.\nThese emails will be notified if any operation on these "
"Attachment Queue's file type fails.",
)

15
attachment_synchronize/readme/CONFIGURE.rst

@ -1,15 +0,0 @@
To use this module, you need to:
* Add a location with your server infos
* Create a task with your file info and remote communication method
* A cron task will trigger each task
.. figure:: ../static/description/file.png
.. figure:: ../static/description/sftp.png
With the help of storage_backend_sftp

1
attachment_synchronize/readme/CONTRIBUTORS.rst

@ -3,6 +3,7 @@
- Valentin CHEMIERE
- Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
- Florian DA COSTA <florian.dacosta@akretion.com>
- Clément MOMBEREAU <clement.mombereau@akretion.com.br>
GS Lab:

7
attachment_synchronize/readme/DESCRIPTION.rst

@ -1,6 +1,5 @@
This module allow you to deal with remote communication to import/export files.
It allow to store paths and settings from/to remote servers.
This module allows to **import/export files** from/to backend servers.
It depends of attachment_queue to store attachments
A backend server is defined by the basic `storage_backend <https://github.com/OCA/storage/tree/12.0/storage_backend>`_ OCA module, while it can be configured (amazon S3, sftp,...) with additional modules from the `storage <https://github.com/oca/storage>`_ repository.
With additional modules coming from https://github.com/storage you can use ftp, sftp, etc
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/12.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.

19
attachment_synchronize/readme/USAGE.rst

@ -0,0 +1,19 @@
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:: ../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:: ../static/description/export_task.png

BIN
attachment_synchronize/static/description/export_task.png

After

Width: 1281  |  Height: 616  |  Size: 61 KiB

BIN
attachment_synchronize/static/description/file.png

Before

Width: 1116  |  Height: 555  |  Size: 41 KiB

BIN
attachment_synchronize/static/description/import_task.png

After

Width: 1296  |  Height: 585  |  Size: 68 KiB

53
attachment_synchronize/static/description/index.html

@ -367,15 +367,14 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/server-tools/tree/12-mig-external_file_location/attachment_synchronize"><img alt="akretion/server-tools" src="https://img.shields.io/badge/github-akretion%2Fserver--tools-lightgray.png?logo=github" /></a></p>
<p>This module allow you to deal with remote communication to import/export files.
It allow to store paths and settings from/to remote servers.</p>
<p>It depends of attachment_queue to store attachments</p>
<p>With additional modules coming from <a class="reference external" href="https://github.com/storage">https://github.com/storage</a> you can use ftp, sftp, etc</p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-tools/tree/12.0/attachment_synchronize"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-attachment_synchronize"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to <strong>import/export files</strong> from/to backend servers.</p>
<p>A backend server is defined by the basic <a class="reference external" href="https://github.com/OCA/storage/tree/12.0/storage_backend">storage_backend</a> OCA module, while it can be configured (amazon S3, sftp,…) with additional modules from the <a class="reference external" href="https://github.com/oca/storage">storage</a> repository.</p>
<p>The imported files (and the files to be exported) are stored in Odoo as <tt class="docutils literal">attachment.queue</tt> objects, defined by the <a class="reference external" href="https://github.com/OCA/server-tools/tree/12.0/attachment_queue">attachment_queue</a> module while the importation itself (resp. exportation) is realized by <strong>“Attachments Import Tasks”</strong> (resp. “Attachments Export Tasks”) defined by this current module.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
@ -385,28 +384,28 @@ It allow to store paths and settings from/to remote servers.</p>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>To use this module, you need to:</p>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>As importation and exportation are different processes, they are triggered in different ways :</p>
<p><strong>To import files</strong>, you need to create an <em>“Attachment Import Task”</em> (menu <em>Settings &gt; Technical &gt; Attachments Import Tasks</em>) which defines :</p>
<ul class="simple">
<li>Add a location with your server infos</li>
<li>Create a task with your file info and remote communication method</li>
<li>A cron task will trigger each task</li>
<li>where to find the files to import from the backend server (path to the files, selection pattern)</li>
<li>what to do with the source files in the backend server (avoid duplicates, delete/rename after import…)</li>
<li>how the files will be processed once imported (through the <strong>File Type</strong> field).</li>
</ul>
<div class="figure">
<img alt="https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/file.png" src="https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/file.png" />
</div>
<div class="figure">
<img alt="https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/sftp.png" src="https://raw.githubusercontent.com/akretion/server-tools/12-mig-external_file_location/attachment_synchronize/static/description/sftp.png" />
</div>
<p>With the help of storage_backend_sftp</p>
<img alt="https://raw.githubusercontent.com/OCA/server-tools/12.0/attachment_synchronize/static/description/import_task.png" src="https://raw.githubusercontent.com/OCA/server-tools/12.0/attachment_synchronize/static/description/import_task.png" />
<blockquote class="epigraph">
🔎 The <strong>File Type</strong> options are defined by other modules built to process the Attachments Queues with the same “File Type”.</blockquote>
<p><strong>To export files</strong>, you need first to register them as <em>“Attachments Queues”</em> objects linked to an <em>“Attachment Export Task”</em> (which set automatically their <strong>File Type</strong> to <em>“Export File (External Location)”</em>).</p>
<p>Then, you can export one file at a time from the <em>Attachment Queue</em>’s form view, or export all the <em>Attachments Queues</em> in a pending state related to the same <em>Export Task</em> from the given <em>Export Task</em> form view (menu <em>Settings &gt; Technical &gt; Attachments Export Tasks</em>) :</p>
<img alt="https://raw.githubusercontent.com/OCA/server-tools/12.0/attachment_synchronize/static/description/export_task.png" src="https://raw.githubusercontent.com/OCA/server-tools/12.0/attachment_synchronize/static/description/export_task.png" />
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/server-tools/issues">GitHub Issues</a>.
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/akretion/server-tools/issues/new?body=module:%20attachment_synchronize%0Aversion:%2012-mig-external_file_location%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20attachment_synchronize%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -424,6 +423,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Valentin CHEMIERE</li>
<li>Mourad EL HADJ MIMOUNE &lt;<a class="reference external" href="mailto:mourad.elhadj.mimoune&#64;akretion.com">mourad.elhadj.mimoune&#64;akretion.com</a>&gt;</li>
<li>Florian DA COSTA &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
<li>Clément MOMBEREAU &lt;<a class="reference external" href="mailto:clement.mombereau&#64;akretion.com.br">clement.mombereau&#64;akretion.com.br</a>&gt;</li>
</ul>
<p>GS Lab:</p>
<ul class="simple">
@ -432,10 +432,15 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>Current maintainers:</p>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/florian-dacosta"><img alt="florian-dacosta" src="https://github.com/florian-dacosta.png?size=40px" /></a> <a class="reference external" href="https://github.com/GSLabIt"><img alt="GSLabIt" src="https://github.com/GSLabIt.png?size=40px" /></a> <a class="reference external" href="https://github.com/bealdav"><img alt="bealdav" src="https://github.com/bealdav.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/server-tools/tree/12-mig-external_file_location/attachment_synchronize">akretion/server-tools</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/12.0/attachment_synchronize">OCA/server-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>

BIN
attachment_synchronize/static/description/sftp.png

Before

Width: 1115  |  Height: 626  |  Size: 32 KiB

Loading…
Cancel
Save