[MIG] base_conditional_image: Migration to 15.0
parent
cda1032d9c
commit
8076a0168b
|
@ -14,16 +14,16 @@ Conditional Images
|
||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
|
||||||
:target: https://github.com/OCA/server-tools/tree/14.0/base_conditional_image
|
:target: https://github.com/OCA/server-tools/tree/15.0/base_conditional_image
|
||||||
:alt: OCA/server-tools
|
:alt: OCA/server-tools
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_conditional_image
|
:target: https://translation.odoo-community.org/projects/server-tools-15-0/server-tools-15-0-base_conditional_image
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/149/14.0
|
:target: https://runbot.odoo-community.org/runbot/149/15.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
|
|
||||||
This module extends the functionality of any model to support conditional images
|
This module extends the functionality of any model to support conditional images
|
||||||
(based on the record attributes) and to manage them either globally or by company.
|
(based on the record attributes) and to manage them either globally or by company.
|
||||||
|
@ -45,11 +45,11 @@ Installation
|
||||||
The sole purpose of this module is to add an abstract model to be inherited.
|
The sole purpose of this module is to add an abstract model to be inherited.
|
||||||
So, you will not notice any changes on install.
|
So, you will not notice any changes on install.
|
||||||
|
|
||||||
To develop using this module, you have to inherit the abstract model `abstract.conditional.image`
|
To develop using this module, you have to inherit the abstract model `conditional.image.consumer.mixin`
|
||||||
to the model that needs the conditional images::
|
to the model that needs the conditional images::
|
||||||
|
|
||||||
class ResPartner(models.Model):
|
class ResPartner(models.Model):
|
||||||
_inherit = ['res.partner', 'abstract.conditional.image']
|
_inherit = ['res.partner', 'conditional.image.consumer.mixin']
|
||||||
_name = 'res.partner'
|
_name = 'res.partner'
|
||||||
|
|
||||||
Then, configure how the images will be selected for each record.
|
Then, configure how the images will be selected for each record.
|
||||||
|
@ -71,7 +71,7 @@ Bug Tracker
|
||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/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.
|
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
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_conditional_image%0Aversion:%2014.0%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:%20base_conditional_image%0Aversion:%2015.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.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ Contributors
|
||||||
|
|
||||||
* `Camptocamp <https://camptocamp.com/>`_:
|
* `Camptocamp <https://camptocamp.com/>`_:
|
||||||
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
||||||
|
* Denis Leemann <denis.leemann@camptocamp.com>
|
||||||
* `Trobz <https://trobz.com>`_:
|
* `Trobz <https://trobz.com>`_:
|
||||||
* Son Ho <sonhd@trobz.com>
|
* Son Ho <sonhd@trobz.com>
|
||||||
|
|
||||||
|
@ -109,6 +110,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_conditional_image>`_ project on GitHub.
|
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/15.0/base_conditional_image>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# Copyright 2019 Camptocamp SA
|
# Copyright 2019-2022 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Conditional Images",
|
"name": "Conditional Images",
|
||||||
"summary": "This module extends the functionality to support conditional images",
|
"summary": "This module extends the functionality to support conditional images",
|
||||||
"version": "14.0.1.0.0",
|
"version": "15.0.1.0.0",
|
||||||
"author": "Camptocamp, Odoo Community Association (OCA)",
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"category": "Misc",
|
"category": "Misc",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 14.0\n"
|
"Project-Id-Version: Odoo Server 15.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -19,18 +19,12 @@ msgid "Abstract image"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: code:addons/base_conditional_image/models/image.py:0
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__company_id
|
||||||
#, python-format
|
|
||||||
msgid "At least one image type must be specified"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__company_id
|
|
||||||
msgid "Company"
|
msgid "Company"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,help:base_conditional_image.field_image__company_id
|
#: model:ir.model.fields,help:base_conditional_image.field_conditional_image__company_id
|
||||||
msgid ""
|
msgid ""
|
||||||
"Company related check. If inherited object does not have a `company_id` "
|
"Company related check. If inherited object does not have a `company_id` "
|
||||||
"field, it will be ignored. The check will first take the records with a "
|
"field, it will be ignored. The check will first take the records with a "
|
||||||
|
@ -38,107 +32,103 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__create_uid
|
#: model:ir.model,name:base_conditional_image.model_conditional_image
|
||||||
|
#: model_terms:ir.ui.view,arch_db:base_conditional_image.view_conditional_image_form
|
||||||
|
msgid "Conditional Image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base_conditional_image
|
||||||
|
#: model:ir.actions.act_window,name:base_conditional_image.conditional_image_action
|
||||||
|
#: model:ir.ui.menu,name:base_conditional_image.conditional_image_menu
|
||||||
|
#: model_terms:ir.ui.view,arch_db:base_conditional_image.view_conditional_image_tree
|
||||||
|
msgid "Conditional Images"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base_conditional_image
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__create_uid
|
||||||
msgid "Created by"
|
msgid "Created by"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__create_date
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__create_date
|
||||||
msgid "Created on"
|
msgid "Created on"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__display_name
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__display_name
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__display_name
|
|
||||||
msgid "Display Name"
|
msgid "Display Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__id
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__id
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__id
|
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model,name:base_conditional_image.model_image
|
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_1920
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__image_1920
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__image
|
|
||||||
msgid "Image"
|
msgid "Image"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.actions.act_window,name:base_conditional_image.image_action
|
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_1024
|
||||||
#: model:ir.ui.menu,name:base_conditional_image.image_menu
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__image_1024
|
||||||
msgid "Images"
|
msgid "Image 1024"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image____last_update
|
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_128
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image____last_update
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__image_128
|
||||||
|
msgid "Image 128"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base_conditional_image
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_256
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__image_256
|
||||||
|
msgid "Image 256"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base_conditional_image
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_512
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__image_512
|
||||||
|
msgid "Image 512"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: base_conditional_image
|
||||||
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image____last_update
|
||||||
msgid "Last Modified on"
|
msgid "Last Modified on"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__write_uid
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__write_uid
|
||||||
msgid "Last Updated by"
|
msgid "Last Updated by"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__write_date
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__write_date
|
||||||
msgid "Last Updated on"
|
msgid "Last Updated on"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_medium
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__model_name
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__image_medium
|
|
||||||
msgid "Medium-sized image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,help:base_conditional_image.field_image__image_medium
|
|
||||||
msgid ""
|
|
||||||
"Medium-sized image. It is automatically resized as a 128x128px image, with "
|
|
||||||
"aspect ratio preserved. Use this field in form views or some kanban views."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__model_name
|
|
||||||
msgid "Model Name"
|
msgid "Model Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__name
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__name
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,help:base_conditional_image.field_image__selector
|
#: model:ir.model.fields,help:base_conditional_image.field_conditional_image__selector
|
||||||
msgid ""
|
msgid ""
|
||||||
"Python expression used as selector when multiple images are usedfor the same"
|
"Python expression used as selector when multiple images are usedfor the "
|
||||||
" object. The variable `object` refers to the actual record on which the "
|
"same object. The variable `object` refers to the actual record on which the "
|
||||||
"expression will be executed. An empty expression will always return `True`."
|
"expression will be executed. An empty expression will always return `True`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
#. module: base_conditional_image
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__selector
|
#: model:ir.model.fields,field_description:base_conditional_image.field_conditional_image__selector
|
||||||
#: model_terms:ir.ui.view,arch_db:base_conditional_image.view_image_form
|
#: model_terms:ir.ui.view,arch_db:base_conditional_image.view_conditional_image_form
|
||||||
msgid "Selector"
|
msgid "Selector"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_abstract_conditional_image__image_small
|
|
||||||
#: model:ir.model.fields,field_description:base_conditional_image.field_image__image_small
|
|
||||||
msgid "Small-sized image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,help:base_conditional_image.field_image__image_small
|
|
||||||
msgid ""
|
|
||||||
"Small-sized image. It is automatically resized as a 64x64px image, with "
|
|
||||||
"aspect ratio preserved. Use this field anywhere a small image is required."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: base_conditional_image
|
|
||||||
#: model:ir.model.fields,help:base_conditional_image.field_image__image
|
|
||||||
msgid "This field holds the standard image, limited to 1024x1024px"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
@ -1,141 +0,0 @@
|
||||||
# Translation of Odoo Server.
|
|
||||||
# This file contains the translation of the following modules:
|
|
||||||
# * custom_image
|
|
||||||
#
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: Odoo Server 9.0e\n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2018-10-02 08:36+0000\n"
|
|
||||||
"PO-Revision-Date: 2018-10-02 08:36+0000\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: custom_image
|
|
||||||
#: code:addons/custom_image/models/image.py:47
|
|
||||||
#, python-format
|
|
||||||
msgid "At least one image type must be specified"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_company_id
|
|
||||||
msgid "Company"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,help:custom_image.field_image_company_id
|
|
||||||
msgid "Company related check. If inherited object does not have a `company_id` field, it will be ignored. The check will first take the records with a company then, if not match is found, the ones without a company."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_create_uid
|
|
||||||
msgid "Created by"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_create_date
|
|
||||||
msgid "Created on"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image_display_name
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_display_name
|
|
||||||
msgid "Display Name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image_id
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_id
|
|
||||||
msgid "ID"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image_image_medium
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image_image_small
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_image
|
|
||||||
msgid "Image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.actions.act_window,name:custom_image.image_action
|
|
||||||
#: model:ir.ui.menu,name:custom_image.image_menu
|
|
||||||
msgid "Images"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_abstract_custom_image___last_update
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image___last_update
|
|
||||||
msgid "Last Modified on"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_write_uid
|
|
||||||
msgid "Last Updated by"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_write_date
|
|
||||||
msgid "Last Updated on"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_image_medium
|
|
||||||
msgid "Medium-sized image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,help:custom_image.field_image_image_medium
|
|
||||||
msgid "Medium-sized image. It is automatically resized as a 128x128px image, with aspect ratio preserved. Use this field in form views or some kanban views."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_model_name
|
|
||||||
msgid "Model Name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_name
|
|
||||||
msgid "Name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,help:custom_image.field_image_selector
|
|
||||||
msgid "Python expression used to distinguish the images for the same object. The variable `object` refer to the actual record on which the expression will be executed. An empty expression will always return `True`."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_selector
|
|
||||||
#: model:ir.ui.view,arch_db:custom_image.view_image_form
|
|
||||||
msgid "Selector"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,field_description:custom_image.field_image_image_small
|
|
||||||
msgid "Small-sized image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,help:custom_image.field_image_image_small
|
|
||||||
msgid "Small-sized image. It is automatically resized as a 64x64px image, with aspect ratio preserved. Use this field anywhere a small image is required."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model.fields,help:custom_image.field_image_image
|
|
||||||
msgid "This field holds the standard image, limited to 1024x1024px"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model,name:custom_image.model_abstract_custom_image
|
|
||||||
msgid "abstract.custom.image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: custom_image
|
|
||||||
#: model:ir.model,name:custom_image.model_image
|
|
||||||
msgid "image"
|
|
||||||
msgstr ""
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
from . import image
|
from . import conditional_image_consumer_mixin
|
||||||
from . import abstract_image
|
from . import conditional_image
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
# Copyright 2019 Camptocamp SA
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
|
||||||
|
|
||||||
from odoo import fields, models
|
|
||||||
from odoo.tools.safe_eval import safe_eval
|
|
||||||
|
|
||||||
|
|
||||||
class AbstractConditionalImage(models.AbstractModel):
|
|
||||||
_name = "abstract.conditional.image"
|
|
||||||
_description = "Abstract image"
|
|
||||||
|
|
||||||
image = fields.Binary(compute="_compute_image", store=False, readonly=True)
|
|
||||||
image_medium = fields.Binary(
|
|
||||||
compute="_compute_image",
|
|
||||||
string="Medium-sized image",
|
|
||||||
store=False,
|
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
image_small = fields.Binary(
|
|
||||||
compute="_compute_image", string="Small-sized image", store=False, readonly=True
|
|
||||||
)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _compute_selector_test_without_company(image_selector, record):
|
|
||||||
return bool(safe_eval(image_selector.selector or "True", {"object": record}))
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _compute_selector_test_with_company(image_selector, record):
|
|
||||||
if (
|
|
||||||
image_selector.company_id == record.company_id
|
|
||||||
or record.company_id
|
|
||||||
and not image_selector.company_id
|
|
||||||
):
|
|
||||||
return AbstractConditionalImage._compute_selector_test_without_company(
|
|
||||||
image_selector, record
|
|
||||||
)
|
|
||||||
return False
|
|
||||||
|
|
||||||
def _compute_image(self):
|
|
||||||
if "company_id" in self._fields:
|
|
||||||
search_clause = [("model_name", "=", self._name)]
|
|
||||||
test_method = self._compute_selector_test_with_company
|
|
||||||
else:
|
|
||||||
# If inherited object doesn't have a `company_id` field,
|
|
||||||
# remove the items with a company defined and the related checks
|
|
||||||
search_clause = [
|
|
||||||
("model_name", "=", self._name),
|
|
||||||
("company_id", "=", False),
|
|
||||||
]
|
|
||||||
test_method = self._compute_selector_test_without_company
|
|
||||||
|
|
||||||
image_selectors = self.env["image"].search(
|
|
||||||
search_clause, order="company_id, selector"
|
|
||||||
)
|
|
||||||
|
|
||||||
for rec in self:
|
|
||||||
found = None
|
|
||||||
for image_selector in image_selectors:
|
|
||||||
if test_method(image_selector, rec):
|
|
||||||
found = image_selector
|
|
||||||
break
|
|
||||||
|
|
||||||
rec.update(
|
|
||||||
{
|
|
||||||
"image": found and found.image,
|
|
||||||
"image_medium": found and found.image_medium,
|
|
||||||
"image_small": found and found.image_small,
|
|
||||||
}
|
|
||||||
)
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Copyright 2022 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ConditionalImage(models.Model):
|
||||||
|
_name = "conditional.image"
|
||||||
|
_description = "Conditional Image"
|
||||||
|
_inherit = ["image.mixin"]
|
||||||
|
|
||||||
|
name = fields.Char(required=True)
|
||||||
|
model_name = fields.Char(required=True)
|
||||||
|
selector = fields.Text(
|
||||||
|
help="Python expression used as selector when multiple images are used"
|
||||||
|
"for the same object. The variable `object` refers "
|
||||||
|
"to the actual record on which the expression will be executed. "
|
||||||
|
"An empty expression will always return `True`.",
|
||||||
|
)
|
||||||
|
company_id = fields.Many2one(
|
||||||
|
"res.company",
|
||||||
|
"Company",
|
||||||
|
help="Company related check. If inherited object does not have a "
|
||||||
|
"`company_id` field, it will be ignored. "
|
||||||
|
"The check will first take the records with a company then, "
|
||||||
|
"if no match is found, the ones without a company.",
|
||||||
|
)
|
|
@ -0,0 +1,67 @@
|
||||||
|
# Copyright 2022 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
from odoo.tools.safe_eval import safe_eval
|
||||||
|
|
||||||
|
|
||||||
|
class ConditionalImageConsumerMixin(models.AbstractModel):
|
||||||
|
_name = "conditional.image.consumer.mixin"
|
||||||
|
_description = "Mixin for conditional images consumers"
|
||||||
|
_inherit = "image.mixin"
|
||||||
|
|
||||||
|
image_1920 = fields.Image(compute="_compute_images", store=False, readonly=True)
|
||||||
|
image_1024 = fields.Image(compute="_compute_images", store=False, readonly=True)
|
||||||
|
image_512 = fields.Image(compute="_compute_images", store=False, readonly=True)
|
||||||
|
image_256 = fields.Image(compute="_compute_images", store=False, readonly=True)
|
||||||
|
image_128 = fields.Image(compute="_compute_images", store=False, readonly=True)
|
||||||
|
|
||||||
|
def _conditional_image_evaluate_selector(self, conditional_image):
|
||||||
|
self.ensure_one()
|
||||||
|
if conditional_image.selector:
|
||||||
|
if (
|
||||||
|
conditional_image.company_id == self.company_id
|
||||||
|
or self.company_id
|
||||||
|
and not conditional_image.company_id
|
||||||
|
):
|
||||||
|
return bool(
|
||||||
|
safe_eval(conditional_image.selector or "True", {"object": self})
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def _compute_images(self):
|
||||||
|
if "company_id" in self._fields:
|
||||||
|
search_clause = [("model_name", "=", self._name)]
|
||||||
|
else:
|
||||||
|
# If inherited object doesn't have a `company_id` field,
|
||||||
|
# remove the items with a company defined and the related checks
|
||||||
|
search_clause = [
|
||||||
|
("model_name", "=", self._name),
|
||||||
|
("company_id", "=", False),
|
||||||
|
]
|
||||||
|
|
||||||
|
conditional_images = self.env["conditional.image"].search(
|
||||||
|
search_clause, order="company_id, selector"
|
||||||
|
)
|
||||||
|
|
||||||
|
for record in self:
|
||||||
|
images_found = conditional_images.filtered(
|
||||||
|
lambda img: record._conditional_image_evaluate_selector(img)
|
||||||
|
)
|
||||||
|
values = {
|
||||||
|
"image_1920": False,
|
||||||
|
"image_1024": False,
|
||||||
|
"image_512": False,
|
||||||
|
"image_256": False,
|
||||||
|
"image_128": False,
|
||||||
|
}
|
||||||
|
if images_found:
|
||||||
|
image = images_found[0]
|
||||||
|
values = {
|
||||||
|
"image_1920": image.image_1920,
|
||||||
|
"image_1024": image.image_1024,
|
||||||
|
"image_512": image.image_512,
|
||||||
|
"image_256": image.image_256,
|
||||||
|
"image_128": image.image_128,
|
||||||
|
}
|
||||||
|
record.update(values)
|
|
@ -1,66 +0,0 @@
|
||||||
# Copyright 2019 Camptocamp SA
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
|
||||||
|
|
||||||
from odoo import _, api, fields, models, tools
|
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
class Image(models.Model):
|
|
||||||
_name = "image"
|
|
||||||
_description = "Image"
|
|
||||||
|
|
||||||
name = fields.Char(required=True)
|
|
||||||
model_name = fields.Char(required=True)
|
|
||||||
selector = fields.Text(
|
|
||||||
help="Python expression used as selector when multiple images are used"
|
|
||||||
"for the same object. The variable `object` refers "
|
|
||||||
"to the actual record on which the expression will be executed. "
|
|
||||||
"An empty expression will always return `True`.",
|
|
||||||
)
|
|
||||||
company_id = fields.Many2one(
|
|
||||||
"res.company",
|
|
||||||
"Company",
|
|
||||||
help="Company related check. If inherited object does not have a "
|
|
||||||
"`company_id` field, it will be ignored. "
|
|
||||||
"The check will first take the records with a company then, "
|
|
||||||
"if no match is found, the ones without a company.",
|
|
||||||
)
|
|
||||||
|
|
||||||
# image: all image fields are base64 encoded and PIL-supported
|
|
||||||
image = fields.Binary(
|
|
||||||
attachment=True,
|
|
||||||
help="This field holds the standard image, limited to 1024x1024px",
|
|
||||||
)
|
|
||||||
image_medium = fields.Binary(
|
|
||||||
"Medium-sized image",
|
|
||||||
attachment=True,
|
|
||||||
help="Medium-sized image. It is automatically "
|
|
||||||
"resized as a 128x128px image, with aspect ratio preserved. "
|
|
||||||
"Use this field in form views or some kanban views.",
|
|
||||||
)
|
|
||||||
image_small = fields.Binary(
|
|
||||||
"Small-sized image",
|
|
||||||
attachment=True,
|
|
||||||
help="Small-sized image. It is automatically "
|
|
||||||
"resized as a 64x64px image, with aspect ratio preserved. "
|
|
||||||
"Use this field anywhere a small image is required.",
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.model
|
|
||||||
def _process_images(self, vals, required=False):
|
|
||||||
if {"image", "image_medium", "image_small"} & set(vals.keys()):
|
|
||||||
vals["image_medium"] = tools.image_process(
|
|
||||||
vals.get("image"), size=(128, 128)
|
|
||||||
)
|
|
||||||
vals["image_small"] = tools.image_process(vals.get("image"), size=(64, 64))
|
|
||||||
elif required:
|
|
||||||
raise ValidationError(_("At least one image type must be specified"))
|
|
||||||
|
|
||||||
@api.model
|
|
||||||
def create(self, vals):
|
|
||||||
self._process_images(vals, required=True)
|
|
||||||
return super().create(vals)
|
|
||||||
|
|
||||||
def write(self, vals):
|
|
||||||
self._process_images(vals)
|
|
||||||
return super().write(vals)
|
|
|
@ -1,4 +1,5 @@
|
||||||
* `Camptocamp <https://camptocamp.com/>`_:
|
* `Camptocamp <https://camptocamp.com/>`_:
|
||||||
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
* Patrick Tombez <patrick.tombez@camptocamp.com>
|
||||||
|
* Denis Leemann <denis.leemann@camptocamp.com>
|
||||||
* `Trobz <https://trobz.com>`_:
|
* `Trobz <https://trobz.com>`_:
|
||||||
* Son Ho <sonhd@trobz.com>
|
* Son Ho <sonhd@trobz.com>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
The sole purpose of this module is to add an abstract model to be inherited.
|
The sole purpose of this module is to add an abstract model to be inherited.
|
||||||
So, you will not notice any changes on install.
|
So, you will not notice any changes on install.
|
||||||
|
|
||||||
To develop using this module, you have to inherit the abstract model `abstract.conditional.image`
|
To develop using this module, you have to inherit the abstract model `conditional.image.consumer.mixin`
|
||||||
to the model that needs the conditional images::
|
to the model that needs the conditional images::
|
||||||
|
|
||||||
class ResPartner(models.Model):
|
class ResPartner(models.Model):
|
||||||
_inherit = ['res.partner', 'abstract.conditional.image']
|
_inherit = ['res.partner', 'conditional.image.consumer.mixin']
|
||||||
_name = 'res.partner'
|
_name = 'res.partner'
|
||||||
|
|
||||||
Then, configure how the images will be selected for each record.
|
Then, configure how the images will be selected for each record.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_conditional_image,Conditional Image,base_conditional_image.model_image,base.group_no_one,1,1,1,1
|
access_conditional_image,Conditional Image,base_conditional_image.model_conditional_image,base.group_no_one,1,1,1,1
|
||||||
access_conditional_image_users,Conditional Image Users,base_conditional_image.model_image,base.group_user,1,0,0,0
|
access_conditional_image_users,Conditional Image Users,base_conditional_image.model_conditional_image,base.group_user,1,0,0,0
|
||||||
|
|
|
|
@ -3,7 +3,7 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||||
<title>Conditional Images</title>
|
<title>Conditional Images</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
||||||
!! This file is generated by oca-gen-addon-readme !!
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
!! changes will be overwritten. !!
|
!! 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/OCA/server-tools/tree/14.0/base_conditional_image"><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-14-0/server-tools-14-0-base_conditional_image"><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/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></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/15.0/base_conditional_image"><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-15-0/server-tools-15-0-base_conditional_image"><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/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||||
<p>This module extends the functionality of any model to support conditional images
|
<p>This module extends the functionality of any model to support conditional images
|
||||||
(based on the record attributes) and to manage them either globally or by company.</p>
|
(based on the record attributes) and to manage them either globally or by company.</p>
|
||||||
<p>The main goal behind this module is to avoid storing the same image multiple times.
|
<p>The main goal behind this module is to avoid storing the same image multiple times.
|
||||||
|
@ -393,11 +393,11 @@ With this module properly set up, it will be stored only one time and you can ch
|
||||||
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
|
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
|
||||||
<p>The sole purpose of this module is to add an abstract model to be inherited.
|
<p>The sole purpose of this module is to add an abstract model to be inherited.
|
||||||
So, you will not notice any changes on install.</p>
|
So, you will not notice any changes on install.</p>
|
||||||
<p>To develop using this module, you have to inherit the abstract model <cite>abstract.conditional.image</cite>
|
<p>To develop using this module, you have to inherit the abstract model <cite>conditional.image.consumer.mixin</cite>
|
||||||
to the model that needs the conditional images:</p>
|
to the model that needs the conditional images:</p>
|
||||||
<pre class="literal-block">
|
<pre class="literal-block">
|
||||||
class ResPartner(models.Model):
|
class ResPartner(models.Model):
|
||||||
_inherit = ['res.partner', 'abstract.conditional.image']
|
_inherit = ['res.partner', 'conditional.image.consumer.mixin']
|
||||||
_name = 'res.partner'
|
_name = 'res.partner'
|
||||||
</pre>
|
</pre>
|
||||||
<p>Then, configure how the images will be selected for each record.</p>
|
<p>Then, configure how the images will be selected for each record.</p>
|
||||||
|
@ -415,7 +415,7 @@ If your object does not have a <cite>company_id</cite> field, this check will be
|
||||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/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.
|
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
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_conditional_image%0Aversion:%2014.0%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:%20base_conditional_image%0Aversion:%2015.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>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<div class="section" id="credits">
|
||||||
|
@ -433,6 +433,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||||
<dt><a class="reference external" href="https://camptocamp.com/">Camptocamp</a>:</dt>
|
<dt><a class="reference external" href="https://camptocamp.com/">Camptocamp</a>:</dt>
|
||||||
<dd><ul class="first last">
|
<dd><ul class="first last">
|
||||||
<li>Patrick Tombez <<a class="reference external" href="mailto:patrick.tombez@camptocamp.com">patrick.tombez@camptocamp.com</a>></li>
|
<li>Patrick Tombez <<a class="reference external" href="mailto:patrick.tombez@camptocamp.com">patrick.tombez@camptocamp.com</a>></li>
|
||||||
|
<li>Denis Leemann <<a class="reference external" href="mailto:denis.leemann@camptocamp.com">denis.leemann@camptocamp.com</a>></li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -458,7 +459,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
promote its widespread use.</p>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/base_conditional_image">OCA/server-tools</a> project on GitHub.</p>
|
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/15.0/base_conditional_image">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>
|
<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>
|
</div>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_image_tree" model="ir.ui.view">
|
<record id="view_conditional_image_tree" model="ir.ui.view">
|
||||||
<field name="name">image.tree</field>
|
<field name="name">conditional.image.tree</field>
|
||||||
<field name="model">image</field>
|
<field name="model">conditional.image</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
|
@ -13,11 +13,11 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_image_form" model="ir.ui.view">
|
<record id="view_conditional_image_form" model="ir.ui.view">
|
||||||
<field name="name">image.form</field>
|
<field name="name">conditional.image.form</field>
|
||||||
<field name="model">image</field>
|
<field name="model">conditional.image</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form string="Conditional Image">
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
|
@ -26,10 +26,10 @@
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field
|
||||||
name="image"
|
name="image_1920"
|
||||||
widget='image'
|
widget='image'
|
||||||
class="oe_avatar"
|
class="oe_avatar"
|
||||||
options='{"preview_image": "image_medium"}'
|
options='{"preview_image": "image_1920"}'
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Selector">
|
<group string="Selector">
|
||||||
|
@ -45,16 +45,16 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="image_action" model="ir.actions.act_window">
|
<record id="conditional_image_action" model="ir.actions.act_window">
|
||||||
<field name="name">Images</field>
|
<field name="name">Conditional Images</field>
|
||||||
<field name="res_model">image</field>
|
<field name="res_model">conditional.image</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.menu" id="image_menu">
|
<record model="ir.ui.menu" id="conditional_image_menu">
|
||||||
<field name="name">Images</field>
|
<field name="name">Conditional Images</field>
|
||||||
<field name="parent_id" ref="base.menu_ir_property" />
|
<field name="parent_id" ref="base.menu_ir_property" />
|
||||||
<field name="action" ref="image_action" />
|
<field name="action" ref="conditional_image_action" />
|
||||||
<field name="sequence" eval="99" />
|
<field name="sequence" eval="99" />
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
Loading…
Reference in New Issue