Initial commit: OCA Storage packages (17 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:06 +02:00
commit 7a380f05d3
659 changed files with 41828 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Fs Base Multi Image
Odoo addon: fs_base_multi_image
## Installation
```bash
pip install odoo-bringout-oca-storage-fs_base_multi_image
```
## Dependencies
This addon depends on:
- fs_image
## Manifest Information
- **Name**: Fs Base Multi Image
- **Version**: 16.0.1.1.1
- **Category**: N/A
- **License**: AGPL-3
- **Installable**: False
## Source
Based on [OCA/storage](https://github.com/OCA/storage) branch 16.0, addon `fs_base_multi_image`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Fs_base_multi_image Module - fs_base_multi_image
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for fs_base_multi_image. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [fs_image](../../odoo-bringout-oca-storage-fs_image)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon fs_base_multi_image or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-storage-fs_base_multi_image"
# or
uv pip install odoo-bringout-oca-storage-fs_base_multi_image"
```

View file

@ -0,0 +1,14 @@
# Models
Detected core models and extensions in fs_base_multi_image.
```mermaid
classDiagram
class fs_image
class fs_image_relation_mixin
class fs_image_mixin
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: fs_base_multi_image. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon fs_base_multi_image
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,77 @@
# Security
Access control and security definitions in fs_base_multi_image.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[all_odoo_addons_repos.txt](../all_odoo_addons_repos.txt)**
- 318 model access rules
- **[bosnian_translations.json](../bosnian_translations.json)**
- 50 model access rules
- **[bosnian_translations_output.json](../bosnian_translations_output.json)**
- 444 model access rules
- **[CHANGELOG.md](../CHANGELOG.md)**
- 132 model access rules
- **[delete_all_odoo_addons.sh](../delete_all_odoo_addons.sh)**
- 50 model access rules
- **[delete_odoo_addons.sh](../delete_odoo_addons.sh)**
- 44 model access rules
- **[doc](../doc)**
- **[docker](../docker)**
- **[input](../input)**
- **[nix](../nix)**
- **[odoo.conf](../odoo.conf)**
- 58 model access rules
- **[odoo_packages_bez_l10n.txt](../odoo_packages_bez_l10n.txt)**
- 1947 model access rules
- **[odoo_packages_bringout.txt](../odoo_packages_bringout.txt)**
- 1947 model access rules
- **[odoo_packages.txt](../odoo_packages.txt)**
- 2085 model access rules
- **[output](../output)**
- **[packages](../packages)**
- **[PACKAGES.md](../PACKAGES.md)**
- 298 model access rules
- **[README.md](../README.md)**
- 338 model access rules
- **[scripts](../scripts)**
- **[temp](../temp)**
- **[TRANSLATION_BS_SUMMARY.md](../TRANSLATION_BS_SUMMARY.md)**
- 146 model access rules
- **[verify_deletions.sh](../verify_deletions.sh)**
- 55 model access rules
## Record Rules
Row-level security rules defined in:
## Security Groups & Configuration
Security groups and permissions defined in:
- **[fs_image.xml](../fs_base_multi_image/security/fs_image.xml)**
- **[res_groups.xml](../fs_base_multi_image/security/res_groups.xml)**
- 1 security groups defined
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[fs_image.xml](../fs_base_multi_image/security/fs_image.xml)**
- Security groups, categories, and XML-based rules
- **[res_groups.xml](../fs_base_multi_image/security/res_groups.xml)**
- Security groups, categories, and XML-based rules
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon fs_base_multi_image
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,115 @@
===================
Fs Base Multi Image
===================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:156cdd22cfc76b0f6518758875151f309bc244f3166cc2ee4bf49026317e4348
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/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%2Fstorage-lightgray.png?logo=github
:target: https://github.com/OCA/storage/tree/16.0/fs_base_multi_image
:alt: OCA/storage
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_base_multi_image
: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/storage&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This addon is a technical addon providing a set of models to ease the
creation of other models that need to be linked to multiple images stored
into external filesystems.
The models provided by this addon are:
* ``fs.image``: a model that stores a reference to an image stored into
an external filesystem.
* ``fs.image.relation.mixin``: an abstract model that can be used to
as base class for models created to store an image linked to a model.
This abstract model defines fields and methods to transparently handle
2 cases:
* the image is specific to the model.
* the image is shared between multiple models and therefore is a ``fs.image`` instance linked to the mixin.
.. 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 <https://odoo-community.org/page/development-status>`_
**Table of contents**
.. contents::
:local:
Usage
=====
To be able to create and or manages shared images, you must have the ``Image Manager``
role. If you do not have this role, as an authenticated user, you can
only view the shared images.
Known issues / Roadmap
======================
* Add dedicated widget to ease the addition of new images to a model linked to
multiple images. (As it's the case in the *storage_image_product* addon)
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/storage/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/storage/issues/new?body=module:%20fs_base_multi_image%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
~~~~~~~
* ACSONE SA/NV
Contributors
~~~~~~~~~~~~
* Laurent Mignon <laurent.mignon@acsone.eu>
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-lmignon| image:: https://github.com/lmignon.png?size=40px
:target: https://github.com/lmignon
:alt: lmignon
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-lmignon|
This module is part of the `OCA/storage <https://github.com/OCA/storage/tree/16.0/fs_base_multi_image>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,34 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Fs Base Multi Image",
"summary": """
Mulitple Images from External File System""",
"version": "16.0.1.1.1",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/storage",
"depends": [
"fs_image",
],
"data": [
"security/res_groups.xml",
"security/fs_image.xml",
"views/fs_image.xml",
"views/fs_image_relation_mixin.xml",
],
"assets": {
"web.assets_backend": [
"fs_base_multi_image/static/src/fields/"
"fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js",
"fs_base_multi_image/static/src/fields/"
"fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.scss",
"fs_base_multi_image/static/src/fields/"
"fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml",
],
},
"demo": [],
"maintainers": ["lmignon"],
"development_status": "Alpha",
}

View file

@ -0,0 +1,196 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fs_base_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js:0
#, python-format
msgid "An error occurred during the images upload."
msgstr "Dogodila se greška tijekom uploada slika."
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Choose how you want to store the new images:"
msgstr "Odaberite kako želite pohraniti nove slike:"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_uid
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Created by"
msgstr "Kreirao"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_date
msgid "Created on"
msgstr "Kreirano"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__display_name
msgid "Display Name"
msgstr "Prikazani naziv"
#. module: fs_base_multi_image
#: model:ir.actions.act_window,name:fs_base_multi_image.fs_image_act_window
msgid "Fs Image"
msgstr "Fs slika"
#. module: fs_base_multi_image
#: model:ir.ui.menu,name:fs_base_multi_image.fs_image_menu
msgid "Fs Images"
msgstr "Fs slike"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Group By"
msgstr "Grupiši po"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__id
msgid "ID"
msgstr "ID"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_form_view
msgid "Image"
msgstr "Slika"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_medium
msgid "Image (128)"
msgstr "Slika (128)"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image
msgid "Image (original)"
msgstr "Slika (originalna)"
#. module: fs_base_multi_image
#: model:res.groups,name:fs_base_multi_image.group_image_manager
msgid "Image Manager"
msgstr "Manager slika"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image_relation_mixin
msgid "Image Relation"
msgstr "Relacija slike"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image_medium
msgid "Image medium"
msgstr "Srednja slika"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image____last_update
msgid "Last Modified on"
msgstr "Zadnje mijenjano"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_uid
msgid "Last Updated by"
msgstr "Zadnji ažurirao"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_date
msgid "Last Updated on"
msgstr "Zadnje ažurirano"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__link_existing
msgid "Link Existing"
msgstr "Povezivanje postojećeg"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_id
msgid "Linked image"
msgstr "Povezana slika"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "MimeType"
msgstr "MimeType"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__mimetype
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__mimetype
msgid "Mimetype"
msgstr "Mimetype"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__name
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__name
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Name"
msgstr "Naziv:"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Reusable images"
msgstr "Slike za ponovna uporaba"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__sequence
msgid "Sequence"
msgstr "Sekvenca"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Specific"
msgstr "Specifično"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image
msgid "Specific Image"
msgstr "Specifična slika"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image_medium
msgid "Specific Image (128)"
msgstr "Specifična slika (128)"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "You can drag and drop images to create new records or"
msgstr "Možete prevući i spustiti slike za stvaranje novih zapisa ili"
#. module: fs_base_multi_image
#. odoo-python
#: code:addons/fs_base_multi_image/models/fs_image_relation_mixin.py:0
#, python-format
msgid "You must set an image"
msgstr "Morate postaviti sliku"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "click here"
msgstr "kliknite ovdje"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "to select image files."
msgstr "za odabir datoteka slika."

View file

@ -0,0 +1,209 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fs_base_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-27 14:36+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\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 4.17\n"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js:0
#, python-format
msgid "An error occurred during the images upload."
msgstr "Se ha producido un error durante la carga de imágenes."
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Choose how you want to store the new images:"
msgstr "Elige cómo quieres almacenar las nuevas imágenes:"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_uid
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Created by"
msgstr "Creado por"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_date
msgid "Created on"
msgstr "Creado el"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"
#. module: fs_base_multi_image
#: model:ir.actions.act_window,name:fs_base_multi_image.fs_image_act_window
msgid "Fs Image"
msgstr "Imagen Fs"
#. module: fs_base_multi_image
#: model:ir.ui.menu,name:fs_base_multi_image.fs_image_menu
msgid "Fs Images"
msgstr "Imágenes Fs"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Group By"
msgstr "Agrupar por"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__id
msgid "ID"
msgstr "ID (identificación)"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_form_view
msgid "Image"
msgstr "Imagen"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_medium
msgid "Image (128)"
msgstr "Imagen (128)"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image
msgid "Image (original)"
msgstr "Imagen (original)"
#. module: fs_base_multi_image
#: model:res.groups,name:fs_base_multi_image.group_image_manager
msgid "Image Manager"
msgstr "Administrador de Imágenes"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image_relation_mixin
msgid "Image Relation"
msgstr "Relación de Imágenes"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image_medium
msgid "Image medium"
msgstr "Imagen mediana"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_uid
msgid "Last Updated by"
msgstr "Última Actualización por"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_date
msgid "Last Updated on"
msgstr "Última Actualización el"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__link_existing
msgid "Link Existing"
msgstr "Enlace Existente"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_id
msgid "Linked image"
msgstr "Imagen vinculada"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "MimeType"
msgstr "Tipo Mimo"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__mimetype
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__mimetype
msgid "Mimetype"
msgstr "Tipo Mimo"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__name
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__name
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Name"
msgstr "Nombre"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Reusable images"
msgstr "Imágenes reutilizables"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__sequence
msgid "Sequence"
msgstr "Secuencia"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Specific"
msgstr "Específico"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image
msgid "Specific Image"
msgstr "Imagen Específica"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image_medium
msgid "Specific Image (128)"
msgstr "Imagen Específica (128)"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "You can drag and drop images to create new records or"
msgstr "Puede arrastrar y soltar imágenes para crear nuevos registros o"
#. module: fs_base_multi_image
#. odoo-python
#: code:addons/fs_base_multi_image/models/fs_image_relation_mixin.py:0
#, python-format
msgid "You must set an image"
msgstr "Usted debe establecer una imagen"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "click here"
msgstr "pulse aquí"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "to select image files."
msgstr "para seleccionar archivos de imagen."
#, python-format
#~ msgid "Cannot set image on a linked image"
#~ msgstr "No se puede establecer la imagen en una imagen vinculada"
#~ msgid "Image 128"
#~ msgstr "Imagen 128"
#~ msgid "Specific Image 128"
#~ msgstr "Imagen Específica 128"

View file

@ -0,0 +1,201 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fs_base_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-07-12 10:58+0000\n"
"Last-Translator: \"Benjamin Willig (ACSONE)\" <benjamin.willig@acsone.eu>\n"
"Language-Team: none\n"
"Language: fr\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: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js:0
#, python-format
msgid "An error occurred during the images upload."
msgstr "Une erreur est apparue lors de l'upload des images."
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Choose how you want to store the new images:"
msgstr "Choisissez où les images seront stockées :"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_uid
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Created by"
msgstr "Créé par"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_date
msgid "Created on"
msgstr "Crée le"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: fs_base_multi_image
#: model:ir.actions.act_window,name:fs_base_multi_image.fs_image_act_window
msgid "Fs Image"
msgstr "Image FS"
#. module: fs_base_multi_image
#: model:ir.ui.menu,name:fs_base_multi_image.fs_image_menu
msgid "Fs Images"
msgstr "Images FS"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Group By"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__id
msgid "ID"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_form_view
msgid "Image"
msgstr "Image"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_medium
msgid "Image (128)"
msgstr "Image (128)"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image
msgid "Image (original)"
msgstr "Image (originale)"
#. module: fs_base_multi_image
#: model:res.groups,name:fs_base_multi_image.group_image_manager
msgid "Image Manager"
msgstr "Gestionnaire des images"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image_relation_mixin
msgid "Image Relation"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image_medium
msgid "Image medium"
msgstr "Image moyenne"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image____last_update
msgid "Last Modified on"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_uid
msgid "Last Updated by"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_date
msgid "Last Updated on"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__link_existing
msgid "Link Existing"
msgstr "Lier une image existante"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_id
msgid "Linked image"
msgstr "Image liée"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "MimeType"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__mimetype
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__mimetype
msgid "Mimetype"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__name
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__name
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Name"
msgstr "Nom"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Reusable images"
msgstr "Images réutilisables"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__sequence
msgid "Sequence"
msgstr "Séquence"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Specific"
msgstr "Spécifique"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image
msgid "Specific Image"
msgstr "Image Spécifique"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image_medium
msgid "Specific Image (128)"
msgstr "Image spécifique (128)"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "You can drag and drop images to create new records or"
msgstr ""
"Vous pouvez glisser/déposer des images pour créer des nouveaux "
"enregistrements ou"
#. module: fs_base_multi_image
#. odoo-python
#: code:addons/fs_base_multi_image/models/fs_image_relation_mixin.py:0
#, python-format
msgid "You must set an image"
msgstr "Vous devez définir une image"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "click here"
msgstr "cliquez ici"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "to select image files."
msgstr "pour sélectionner des fichiers."

View file

@ -0,0 +1,196 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fs_base_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js:0
#, python-format
msgid "An error occurred during the images upload."
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Choose how you want to store the new images:"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_uid
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Created by"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_date
msgid "Created on"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__display_name
msgid "Display Name"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.actions.act_window,name:fs_base_multi_image.fs_image_act_window
msgid "Fs Image"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.ui.menu,name:fs_base_multi_image.fs_image_menu
msgid "Fs Images"
msgstr ""
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Group By"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__id
msgid "ID"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_form_view
msgid "Image"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_medium
msgid "Image (128)"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image
msgid "Image (original)"
msgstr ""
#. module: fs_base_multi_image
#: model:res.groups,name:fs_base_multi_image.group_image_manager
msgid "Image Manager"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image_relation_mixin
msgid "Image Relation"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image_medium
msgid "Image medium"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image____last_update
msgid "Last Modified on"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_uid
msgid "Last Updated by"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_date
msgid "Last Updated on"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__link_existing
msgid "Link Existing"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_id
msgid "Linked image"
msgstr ""
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "MimeType"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__mimetype
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__mimetype
msgid "Mimetype"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__name
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__name
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Name"
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Reusable images"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__sequence
msgid "Sequence"
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Specific"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image
msgid "Specific Image"
msgstr ""
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image_medium
msgid "Specific Image (128)"
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "You can drag and drop images to create new records or"
msgstr ""
#. module: fs_base_multi_image
#. odoo-python
#: code:addons/fs_base_multi_image/models/fs_image_relation_mixin.py:0
#, python-format
msgid "You must set an image"
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "click here"
msgstr ""
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "to select image files."
msgstr ""

View file

@ -0,0 +1,217 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fs_base_multi_image
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-22 09:37+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.esm.js:0
#, python-format
msgid "An error occurred during the images upload."
msgstr "Si è verificato un errore durante il caricamento dell'immagine."
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Choose how you want to store the new images:"
msgstr "Scegliere come archiviare le nuove immagini:"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_uid
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Created by"
msgstr "Creato da"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__create_date
msgid "Created on"
msgstr "Creato il"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: fs_base_multi_image
#: model:ir.actions.act_window,name:fs_base_multi_image.fs_image_act_window
msgid "Fs Image"
msgstr "Immagine FS"
#. module: fs_base_multi_image
#: model:ir.ui.menu,name:fs_base_multi_image.fs_image_menu
msgid "Fs Images"
msgstr "Immagini FS"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Group By"
msgstr "Raggruppa per"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__id
msgid "ID"
msgstr "ID"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_form_view
msgid "Image"
msgstr "Immagine"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_medium
msgid "Image (128)"
msgstr "Immagine 128"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image
msgid "Image (original)"
msgstr "Immagine (originale)"
#. module: fs_base_multi_image
#: model:res.groups,name:fs_base_multi_image.group_image_manager
msgid "Image Manager"
msgstr "Gestore immagine"
#. module: fs_base_multi_image
#: model:ir.model,name:fs_base_multi_image.model_fs_image_relation_mixin
msgid "Image Relation"
msgstr "Relazione immagine"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__image_medium
msgid "Image medium"
msgstr "Immagine media"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__link_existing
msgid "Link Existing"
msgstr "Collegamento esistente"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__image_id
msgid "Linked image"
msgstr "Immagine collegata"
#. module: fs_base_multi_image
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "MimeType"
msgstr "Tipo MIME"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__mimetype
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__mimetype
msgid "Mimetype"
msgstr "Tipo MIME"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image__name
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__name
#: model_terms:ir.ui.view,arch_db:fs_base_multi_image.fs_image_search_view
msgid "Name"
msgstr "Nome"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Reusable images"
msgstr "Immagini riutilizzabili"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__sequence
msgid "Sequence"
msgstr "Sequenza"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "Specific"
msgstr "Specifica"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image
msgid "Specific Image"
msgstr "Immagine specifica"
#. module: fs_base_multi_image
#: model:ir.model.fields,field_description:fs_base_multi_image.field_fs_image_relation_mixin__specific_image_medium
msgid "Specific Image (128)"
msgstr "Immagine specifica (128)"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "You can drag and drop images to create new records or"
msgstr "Si possono trascinare e rilasciare immagini per creare nuovi record o"
#. module: fs_base_multi_image
#. odoo-python
#: code:addons/fs_base_multi_image/models/fs_image_relation_mixin.py:0
#, python-format
msgid "You must set an image"
msgstr "Bisogna impostare una immagine"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "click here"
msgstr "fare clic qui"
#. module: fs_base_multi_image
#. odoo-javascript
#: code:addons/fs_base_multi_image/static/src/fields/fs_image_relation_dnd_upload/fs_image_relation_dnd_upload.xml:0
#, python-format
msgid "to select image files."
msgstr "per selezionare file immagine."
#, python-format
#~ msgid "fs_image"
#~ msgstr "fs_image"
#, python-format
#~ msgid "specific"
#~ msgstr "specifica"
#, python-format
#~ msgid "Cannot set image on a linked image"
#~ msgstr "Non si può impostare una immagin in una immagine collegata"
#~ msgid "Image 128"
#~ msgstr "Immagine 128"
#~ msgid "Specific Image 128"
#~ msgstr "Immagine specifica 128"

View file

@ -0,0 +1,2 @@
from . import fs_image
from . import fs_image_relation_mixin

View file

@ -0,0 +1,29 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.addons.fs_image import fields as fs_fields
class FsImage(models.Model):
_name = "fs.image"
_inherit = "fs.image.mixin"
_description = "Image"
_order = "name, id"
_rec_name = "name"
image = fs_fields.FSImage(required=True) # makes field required
name = fields.Char(compute="_compute_name", store=True, index=True)
mimetype = fields.Char(compute="_compute_mimetype", store=True)
@api.depends("image")
def _compute_name(self):
for record in self:
record.name = record.image.name if record.image else None
@api.depends("image")
def _compute_mimetypes(self):
for record in self:
record.mimetype = record.image.mimetype if record.image else None

View file

@ -0,0 +1,104 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.addons.fs_image import fields as fs_fields
class FsImageRelationMixin(models.AbstractModel):
_name = "fs.image.relation.mixin"
_description = "Image Relation"
_order = "sequence, name"
_rec_name = "name"
sequence = fields.Integer()
image_id = fields.Many2one(
comodel_name="fs.image",
string="Linked image",
)
specific_image = fs_fields.FSImage("Specific Image")
# resized fields stored (as attachment) for performance
specific_image_medium = fs_fields.FSImage(
"Specific Image (128)",
related="specific_image",
max_width=128,
max_height=128,
store=True,
)
link_existing = fields.Boolean(default=False)
image = fs_fields.FSImage(
"Image (original)",
compute="_compute_image",
inverse="_inverse_image",
store=False,
)
# resized fields stored (as attachment) for performance
image_medium = fs_fields.FSImage(
"Image (128)", compute="_compute_image_medium", store=False
)
name = fields.Char(compute="_compute_name", store=True, index=True)
mimetype = fields.Char(compute="_compute_mimetype", store=True)
@api.constrains("specific_image", "image_id")
def _check_image(self):
for record in self:
if not record.image_id and not record.specific_image:
raise ValidationError(_("You must set an image"))
@api.depends("image")
def _compute_name(self):
for record in self:
record.name = record.image.name if record.image else None
@api.depends("image")
def _compute_mimetypes(self):
for record in self:
record.mimetype = record.image.mimetype if record.image else None
@api.depends("image_id", "specific_image", "link_existing")
def _compute_image(self):
for record in self:
if record.link_existing:
record.image = record.image_id.image
else:
record.image = record.specific_image
@api.depends("image_id", "specific_image", "link_existing")
def _compute_image_medium(self):
for record in self:
if record.link_existing:
record.image_medium = record.image_id.image_medium
else:
record.image_medium = record.specific_image_medium
def _inverse_image(self):
for record in self:
if not record.link_existing:
record.specific_image = record.image
@api.model
def _cleanup_vals(self, vals):
link_existing = vals.get("link_existing")
if link_existing:
if "specific_image" in vals:
vals.pop("specific_image")
if "image" in vals:
# image is set when using the kanban renderer so it
# prevents the name field to be computed well
vals.pop("image")
return vals
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
self._cleanup_vals(vals)
return super().create(vals_list)
def write(self, vals):
self._cleanup_vals(vals)
return super().write(vals)

View file

@ -0,0 +1 @@
* Laurent Mignon <laurent.mignon@acsone.eu>

View file

@ -0,0 +1,14 @@
This addon is a technical addon providing a set of models to ease the
creation of other models that need to be linked to multiple images stored
into external filesystems.
The models provided by this addon are:
* ``fs.image``: a model that stores a reference to an image stored into
an external filesystem.
* ``fs.image.relation.mixin``: an abstract model that can be used to
as base class for models created to store an image linked to a model.
This abstract model defines fields and methods to transparently handle
2 cases:
* the image is specific to the model.
* the image is shared between multiple models and therefore is a ``fs.image`` instance linked to the mixin.

View file

@ -0,0 +1,2 @@
* Add dedicated widget to ease the addition of new images to a model linked to
multiple images. (As it's the case in the *storage_image_product* addon)

View file

@ -0,0 +1,3 @@
To be able to create and or manages shared images, you must have the ``Image Manager``
role. If you do not have this role, as an authenticated user, you can
only view the shared images.

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.model.access" id="fs_image_access_read">
<field name="name">fs.image access read</field>
<field name="model_id" ref="model_fs_image" />
<field name="group_id" ref="base.group_user" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="0" />
<field name="perm_write" eval="0" />
<field name="perm_unlink" eval="0" />
</record>
<record model="ir.model.access" id="fs_image_access_manage">
<field name="name">fs.image access manage</field>
<field name="model_id" ref="model_fs_image" />
<field name="group_id" ref="group_image_manager" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_unlink" eval="1" />
</record>
</odoo>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="res.groups" id="group_image_manager">
<field name="name">Image Manager</field>
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,456 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Fs Base Multi Image</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="fs-base-multi-image">
<h1 class="title">Fs Base Multi Image</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:156cdd22cfc76b0f6518758875151f309bc244f3166cc2ee4bf49026317e4348
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" 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 image-reference" href="https://github.com/OCA/storage/tree/16.0/fs_base_multi_image"><img alt="OCA/storage" src="https://img.shields.io/badge/github-OCA%2Fstorage-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_base_multi_image"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/storage&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon is a technical addon providing a set of models to ease the
creation of other models that need to be linked to multiple images stored
into external filesystems.</p>
<p>The models provided by this addon are:</p>
<ul class="simple">
<li><tt class="docutils literal">fs.image</tt>: a model that stores a reference to an image stored into
an external filesystem.</li>
<li><tt class="docutils literal">fs.image.relation.mixin</tt>: an abstract model that can be used to
as base class for models created to store an image linked to a model.
This abstract model defines fields and methods to transparently handle
2 cases:
* the image is specific to the model.
* the image is shared between multiple models and therefore is a <tt class="docutils literal">fs.image</tt> instance linked to the mixin.</li>
</ul>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">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.
<a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p>
</div>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To be able to create and or manages shared images, you must have the <tt class="docutils literal">Image Manager</tt>
role. If you do not have this role, as an authenticated user, you can
only view the shared images.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Add dedicated widget to ease the addition of new images to a model linked to
multiple images. (As its the case in the <em>storage_image_product</em> addon)</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/storage/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/storage/issues/new?body=module:%20fs_base_multi_image%0Aversion:%2016.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">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<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">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/lmignon"><img alt="lmignon" src="https://github.com/lmignon.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/storage/tree/16.0/fs_base_multi_image">OCA/storage</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>
</body>
</html>

View file

@ -0,0 +1,232 @@
/** @odoo-module **/
import {blockUI, unblockUI} from "web.framework";
import {onWillRender, useRef, useState} from "@odoo/owl";
import {X2ManyField} from "@web/views/fields/x2many/x2many_field";
import {registry} from "@web/core/registry";
import {useX2ManyCrud} from "@web/views/fields/relational_utils";
export class FsImageRelationDndUploadField extends X2ManyField {
/**
* When using this widget, displayed image relation views must contains
* following fields:
* - sequence
* - image_id
* - specific_image
* - link_existing
*/
setup() {
super.setup();
this.options = this.activeField.options;
this.defaultTarget = this.options.target || "specific";
this.state = useState({
dragging: false,
target: this.defaultTarget,
});
this.fileInput = useRef("fileInput");
this.defaultSequence = 0;
this.operations = useX2ManyCrud(() => this.list, this.isMany2Many);
onWillRender(() => {
this.initDefaultSequence();
});
}
get targetImage() {
return this.state.target;
}
get relationRecordId() {
return this.props.record.data.id;
}
get displayDndZone() {
const activeActions = this.activeActions;
return (
("link" in activeActions ? activeActions.link : activeActions.create) &&
!this.props.readonly
);
}
initDefaultSequence() {
let sequence = 0;
_.each(this.props.value.records, (record) => {
sequence = record.data.sequence;
if (sequence >= this.defaultSequence) {
this.defaultSequence = sequence + 1;
}
});
}
getNewSequence() {
const sequence = this.defaultSequence;
this.defaultSequence += 1;
return sequence;
}
setDragging() {
this.state.dragging = true;
}
setNotDragging() {
this.state.dragging = false;
}
onDragEnter(ev) {
ev.preventDefault();
this.setDragging();
}
onDragLeave(ev) {
ev.preventDefault();
this.setNotDragging();
}
onClickSelectDocuments(ev) {
ev.preventDefault();
this.fileInput.el.click();
}
onDrop(ev) {
ev.preventDefault();
this.setNotDragging();
this.uploadImages(ev.dataTransfer.files);
}
onFilesSelected(ev) {
ev.preventDefault();
this.uploadImages(ev.target.files);
}
onChangeImageTarget(ev) {
this.state.target = ev.target.value;
}
async uploadFsImage(imagesDesc) {
const self = this;
self.env.model.orm
.call("fs.image", "create", [imagesDesc])
.then((fsImageIds) => {
let values = {};
_.each(fsImageIds, (fsImageId) => {
values = self.getFsImageRelationValues(fsImageId);
self.createFieldRelationRecords(values);
});
unblockUI();
})
.catch(() => {
self.displayUploadError();
});
}
displayUploadError() {
unblockUI();
this.env.services.notification.add(
this.env._t("An error occurred during the images upload."),
{
type: "danger",
sticky: true,
}
);
}
getFsImageRelationValues(fsImageId) {
let values = {
default_image_id: fsImageId,
default_link_existing: true,
};
values = {...values, ...this.getRelationCommonValues()};
return values;
}
async uploadSpecificImage(imagesDesc) {
const self = this;
_.each(imagesDesc, (imageDesc) => {
self.createFieldRelationRecords(
self.getSpecificImageRelationValues(imageDesc)
);
});
unblockUI();
}
getSpecificImageRelationValues(imageDesc) {
return {
...this.getRelationCommonValues(),
default_specific_image: imageDesc.image,
};
}
getRelationCommonValues() {
return {
default_sequence: this.getNewSequence(),
};
}
async createFieldRelationRecords(createValues) {
await this.list.addNew({
position: "bottom",
context: createValues,
mode: "readonly",
allowWarning: true,
});
}
async uploadImages(files) {
const self = this;
const promises = [];
blockUI();
_.each(files, function (file) {
if (!file.type.includes("image")) {
return;
}
const filePromise = new Promise(function (resolve) {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (upload) {
let data = upload.target.result;
data = data.split(",")[1];
resolve([file.name, data]);
};
});
promises.push(filePromise);
});
return Promise.all(promises).then(function (fileContents) {
const imagesDesc = [];
_.each(fileContents, function (fileContent) {
imagesDesc.push(self.getFileImageDesc(fileContent));
});
if (imagesDesc.length > 0) {
switch (self.targetImage) {
case "fs_image":
self.uploadFsImage(imagesDesc);
break;
case "specific":
self.uploadSpecificImage(imagesDesc);
break;
default:
unblockUI();
}
} else {
unblockUI();
}
});
}
getFileImageDesc(fileContent) {
return {
image: {
filename: fileContent[0],
content: fileContent[1],
},
};
}
}
FsImageRelationDndUploadField.template = "web.FsImageRelationDndUploadField";
registry
.category("fields")
.add("fs_image_relation_dnd_upload", FsImageRelationDndUploadField);

View file

@ -0,0 +1,38 @@
.o_field_x2many {
.dnd-zone {
display: table;
padding: 10px;
width: 90%;
margin: auto;
margin-top: 5px;
min-height: 100px;
border: 1px solid transparent;
border-color: var(--notebook-link-border-color, transparent);
text-align: center;
&.dragging-inside {
outline: 2px dashed #a096be;
outline-offset: -10px;
}
.row {
display: table-row;
div {
vertical-align: middle;
display: table-cell;
text-align: center;
select[name="fs_image_target"] {
display: inline-block;
width: fit-content;
color: #01666b;
}
}
}
input[name="files"] {
display: none;
}
}
}

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t
t-name="web.FsImageRelationDndUploadField"
t-inherit="web.X2ManyField"
t-inherit-mode="primary"
owl="1"
>
<xpath expr="//div[hasclass('o_x2m_control_panel')]" position="before">
<t t-if="displayDndZone">
<div
t-attf-class="dnd-zone {{state.dragging ? 'dragging-inside' : ''}}"
t-on-drop="ev => this.onDrop(ev)"
t-on-dragenter="ev => this.onDragEnter(ev)"
t-on-dragover="ev => this.onDragEnter(ev)"
t-on-dragleave="ev => this.onDragLeave(ev)"
>
<div class="row">
<div>
You can drag and drop images to create new records or <a
href="#"
t-on-click="onClickSelectDocuments"
>click here</a> to select image files.
</div>
</div>
<div class="row" name="target_selection">
<div>
Choose how you want to store the new images:
<select
name="fs_image_target"
t-on-change="onChangeImageTarget"
class="o_input pe-3"
>
<option
value="fs_image"
t-att-selected="state.target == 'fs_image'"
>Reusable images</option>
<option
value="specific"
t-att-selected="state.target == 'specific'"
>Specific</option>
</select>
</div>
</div>
<input
t-ref="fileInput"
type="file"
name="files"
multiple="true"
t-on-change="onFilesSelected"
accept="image/*"
/>
</div>
</t>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="fs_image_form_view">
<field name="name">fs.image.form (in fs_base_multi_image)</field>
<field name="model">fs.image</field>
<field name="arch" type="xml">
<form>
<sheet>
<label for="name" />
<h1>
<field name="name" />
</h1>
<group>
<group>
<field name="image" string="Image" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="fs_image_search_view">
<field name="name">fs.image.search (in fs_base_multi_image)</field>
<field name="model">fs.image</field>
<field name="arch" type="xml">
<search>
<field
name="name"
filter_domain="[('name','ilike',self)]"
string="Name"
/>
<separator />
<field name="create_uid" string="Created by" />
<field name="mimetype" />
<group expand="0" string="Group By">
<filter
string="MimeType"
name="mimetype"
domain="[]"
context="{'group_by':'mimetype'}"
/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="fs_image_tree_view">
<field name="name">fs.image.tree (in fs_base_multi_image)</field>
<field name="model">fs.image</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="create_uid" />
<field name="create_date" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="fs_image_act_window">
<field name="name">Fs Image</field>
<field name="res_model">fs.image</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
<record model="ir.ui.menu" id="fs_image_menu">
<field name="name">Fs Images</field>
<field name="parent_id" ref="fs_storage.menu_storage" />
<field name="action" ref="fs_image_act_window" />
</record>
</odoo>

View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="fs_image_relation_mixin_form_view">
<field name="name">fs.image.relation.mixin.form</field>
<field name="model">fs.image.relation.mixin</field>
<field name="arch" type="xml">
<form>
<sheet>
<field
name="image"
class="oe_avatar"
options="{'preview_image': 'image_medium', 'zoom': true}"
readonly="1"
attrs="{'invisible': [('link_existing', '=', False)]}"
/>
<field
name="specific_image"
class="oe_avatar"
options="{'preview_image': 'image_medium', 'zoom': true}"
attrs="{'invisible': [('link_existing', '=', True)]}"
/>
<group>
<field name="link_existing" />
<field name="name" />
<field name="sequence" />
<field
name="image_id"
attrs="{'invisible': [('link_existing', '=', False)]}"
/>
</group>
<group name="extra">
<!-- Add here custom relation fields -->
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="fs_image_relation_mixin_kanban_view">
<field name="name">fs.image.relation.mixin.kanban</field>
<field name="model">fs.image.relation.mixin</field>
<field name="arch" type="xml">
<kanban>
<field name="image" />
<field name="sequence" />
<field name="image_id" />
<field name="specific_image" />
<field name="link_existing" />
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<a
type="delete"
style="position: absolute; right: 0; padding: 4px; display: inline-block"
>X</a>
<div class="o_kanban_image me-1" />
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name" />
</strong>
</div>
</div>
<div name="extra" class="mt-1" />
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</odoo>

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-storage-fs_base_multi_image"
version = "16.0.0"
description = "Fs Base Multi Image -
Mulitple Images from External File System"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-storage-fs_image>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["fs_base_multi_image"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]