diff --git a/iot_template_oca/README.rst b/iot_template_oca/README.rst new file mode 100644 index 00000000..670f79aa --- /dev/null +++ b/iot_template_oca/README.rst @@ -0,0 +1,90 @@ +============= +IoT Templates +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5394ea1bd728715365f1e558616d5a5e729d3d022698dfc172f2a0a1e83b59b7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fiot-lightgray.png?logo=github + :target: https://github.com/OCA/iot/tree/17.0/iot_template_oca + :alt: OCA/iot +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/iot-17-0/iot-17-0-iot_template_oca + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/iot&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Create a system of templates for IoT devices. + +When we are using a template we can configure a device with a simple URL +configuration. The device will contact odoo and send the template name. +Odoo will create the device and respond with all the expected data. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. Create a template with a module or in Iot > Templates +2. Access Iot > Config Device +3. Confirm that you want to configurate a new device +4. Copy the URL +5. Access the device and send it the configuration url +6. The device will contact odoo and automatically configure itself. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Creu Blanca + +Contributors +------------ + +- Enric Tobella + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/iot `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/iot_template_oca/__init__.py b/iot_template_oca/__init__.py new file mode 100644 index 00000000..fa0ba4bf --- /dev/null +++ b/iot_template_oca/__init__.py @@ -0,0 +1,3 @@ +from . import controller +from . import models +from . import wizards diff --git a/iot_template_oca/__manifest__.py b/iot_template_oca/__manifest__.py new file mode 100644 index 00000000..93056eec --- /dev/null +++ b/iot_template_oca/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright (C) 2018 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "IoT Templates", + "version": "17.0.1.0.0", + "category": "IoT", + "author": "Creu Blanca, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "summary": "IoT module for managing templates", + "depends": ["iot_input_oca", "iot_output_oca"], + "website": "https://github.com/OCA/iot", + "data": [ + "security/ir.model.access.csv", + "wizards/iot_device_configure.xml", + "views/iot_template_views.xml", + ], + "demo": ["demo/iot_template.xml"], +} diff --git a/iot_template_oca/controller/__init__.py b/iot_template_oca/controller/__init__.py new file mode 100644 index 00000000..96960bb9 --- /dev/null +++ b/iot_template_oca/controller/__init__.py @@ -0,0 +1 @@ +from . import iot_controller diff --git a/iot_template_oca/controller/iot_controller.py b/iot_template_oca/controller/iot_controller.py new file mode 100644 index 00000000..c7791e1c --- /dev/null +++ b/iot_template_oca/controller/iot_controller.py @@ -0,0 +1,25 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import json + +from odoo import http + + +class CallIot(http.Controller): + @http.route( + ["/iot//configure"], + type="http", + auth="none", + methods=["POST"], + csrf=False, + ) + def configure_iot(self, serial, template, **kwargs): + request = http.request + if not request.env: + return json.dumps(False) + return json.dumps( + request.env["iot.device.configure"] + .sudo() + .configure(serial, template, **kwargs) + ) diff --git a/iot_template_oca/demo/iot_template.xml b/iot_template_oca/demo/iot_template.xml new file mode 100644 index 00000000..b92ca8c5 --- /dev/null +++ b/iot_template_oca/demo/iot_template.xml @@ -0,0 +1,17 @@ + + + + demo_template + + + + serial + + + + demo_input + + test_input_device + {} + + diff --git a/iot_template_oca/i18n/es.po b/iot_template_oca/i18n/es.po new file mode 100644 index 00000000..0861cf0e --- /dev/null +++ b/iot_template_oca/i18n/es.po @@ -0,0 +1,292 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * iot_template_oca +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-15 17:38+0000\n" +"Last-Translator: Ivorra78 \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: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_device_configuration_menu +msgid "Add a new Device" +msgstr "Añadir un nuevo Dispositivo" + +#. module: iot_template_oca +#: model:ir.actions.server,name:iot_template_oca.configure_action +msgid "Apply Template" +msgstr "Aplicar Plantilla" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Apply template" +msgstr "Aplicar plantilla" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_function +msgid "Call Function" +msgstr "Función de Llamada" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_model_id +msgid "Call Model" +msgstr "Modelo de Llamada" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Close" +msgstr "Cerrar" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__communication_system_id +msgid "Communication System" +msgstr "Sistema de Comunicación" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Configuration URL" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_configure +msgid "Configure a IoT device" +msgstr "Configurar un dispositivo IoT" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_input +msgid "Device input" +msgstr "Entrada del dispositivo" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__group_id +msgid "Group" +msgstr "Grupo" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__icon +msgid "Icon" +msgstr "Icono" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1920 +msgid "Image" +msgstr "Imagen" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1024 +msgid "Image 1024" +msgstr "Imagen 1024" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_128 +msgid "Image 128" +msgstr "Imagen 128" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_256 +msgid "Image 256" +msgstr "Imagen 256" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_512 +msgid "Image 512" +msgstr "Imagen 512" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__input_ids +msgid "Input" +msgstr "Entrada" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Inputs" +msgstr "Entradas" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device +#: model:ir.model,name:iot_template_oca.model_iot_device_output +msgid "IoT Device" +msgstr "Dispositivo IoT" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_input +msgid "IoT Input for Template" +msgstr "Entrada IoT para Plantilla" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_key +msgid "IoT Keys for configuration" +msgstr "Claves IoT para la configuración" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template +msgid "IoT Template for Device" +msgstr "Plantilla IoT para Dispositivos" + +#. module: iot_template_oca +#: model:ir.actions.act_window,name:iot_template_oca.iot_template_action +msgid "IoT Templates" +msgstr "Plantillas IoT" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__key_ids +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__key +msgid "Key" +msgstr "Clave" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Keys" +msgstr "Llaves" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_uid +msgid "Last Updated by" +msgstr "Última Actualización por" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_date +msgid "Last Updated on" +msgstr "Última Actualización el" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__name +msgid "Name" +msgstr "Nombre" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__output_ids +msgid "Output" +msgstr "Salida" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_output +msgid "Output templates for IoT" +msgstr "Plantillas de salida para IoT" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Outputs" +msgstr "Salidas" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__params +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__params +msgid "Params" +msgstr "Parámetros" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_id +msgid "Parent" +msgstr "Parental" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_path +msgid "Parent Path" +msgstr "Ruta Parental" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__serial +msgid "Serial" +msgstr "Serie" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__tag_ids +msgid "Tag" +msgstr "Etiqueta" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__template_id +msgid "Template" +msgstr "Plantilla" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_input__template_input_id +msgid "Template Input" +msgstr "Entrada de Plantilla" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_output__template_output_id +msgid "Template Output" +msgstr "Salida de Plantilla" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_template_menu +msgid "Templates" +msgstr "Plantillas" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__url +msgid "Url" +msgstr "Url" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Use this URL on your device configuration" +msgstr "Utilice esta URL en la configuración de su dispositivo" diff --git a/iot_template_oca/i18n/fa.po b/iot_template_oca/i18n/fa.po new file mode 100644 index 00000000..01385634 --- /dev/null +++ b/iot_template_oca/i18n/fa.po @@ -0,0 +1,290 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * iot_template_oca +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: fa\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" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_device_configuration_menu +msgid "Add a new Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.actions.server,name:iot_template_oca.configure_action +msgid "Apply Template" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Apply template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_function +msgid "Call Function" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_model_id +msgid "Call Model" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Close" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__communication_system_id +msgid "Communication System" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Configuration URL" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_configure +msgid "Configure a IoT device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_uid +msgid "Created by" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_date +msgid "Created on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_input +msgid "Device input" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__display_name +msgid "Display Name" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__group_id +msgid "Group" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__id +msgid "ID" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__icon +msgid "Icon" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1920 +msgid "Image" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1024 +msgid "Image 1024" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_128 +msgid "Image 128" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_256 +msgid "Image 256" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_512 +msgid "Image 512" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__input_ids +msgid "Input" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Inputs" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device +#: model:ir.model,name:iot_template_oca.model_iot_device_output +msgid "IoT Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_input +msgid "IoT Input for Template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_key +msgid "IoT Keys for configuration" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template +msgid "IoT Template for Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.actions.act_window,name:iot_template_oca.iot_template_action +msgid "IoT Templates" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__key_ids +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__key +msgid "Key" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Keys" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output____last_update +msgid "Last Modified on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_date +msgid "Last Updated on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__name +msgid "Name" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__output_ids +msgid "Output" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_output +msgid "Output templates for IoT" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Outputs" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__params +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__params +msgid "Params" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_id +msgid "Parent" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_path +msgid "Parent Path" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__serial +msgid "Serial" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__tag_ids +msgid "Tag" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__template_id +msgid "Template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_input__template_input_id +msgid "Template Input" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_output__template_output_id +msgid "Template Output" +msgstr "" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_template_menu +msgid "Templates" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__url +msgid "Url" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Use this URL on your device configuration" +msgstr "" diff --git a/iot_template_oca/i18n/iot_template_oca.pot b/iot_template_oca/i18n/iot_template_oca.pot new file mode 100644 index 00000000..4a854573 --- /dev/null +++ b/iot_template_oca/i18n/iot_template_oca.pot @@ -0,0 +1,289 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * iot_template_oca +# +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: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_device_configuration_menu +msgid "Add a new Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.actions.server,name:iot_template_oca.configure_action +msgid "Apply Template" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Apply template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_function +msgid "Call Function" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_model_id +msgid "Call Model" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Close" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__communication_system_id +msgid "Communication System" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Configuration URL" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_configure +msgid "Configure a IoT device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_uid +msgid "Created by" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_date +msgid "Created on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_input +msgid "Device input" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__display_name +msgid "Display Name" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__group_id +msgid "Group" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__id +msgid "ID" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__icon +msgid "Icon" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1920 +msgid "Image" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1024 +msgid "Image 1024" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_128 +msgid "Image 128" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_256 +msgid "Image 256" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_512 +msgid "Image 512" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__input_ids +msgid "Input" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Inputs" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device +#: model:ir.model,name:iot_template_oca.model_iot_device_output +msgid "IoT Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_input +msgid "IoT Input for Template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_key +msgid "IoT Keys for configuration" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template +msgid "IoT Template for Device" +msgstr "" + +#. module: iot_template_oca +#: model:ir.actions.act_window,name:iot_template_oca.iot_template_action +msgid "IoT Templates" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__key_ids +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__key +msgid "Key" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Keys" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output____last_update +msgid "Last Modified on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_date +msgid "Last Updated on" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__name +msgid "Name" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__output_ids +msgid "Output" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_output +msgid "Output templates for IoT" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Outputs" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__params +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__params +msgid "Params" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_id +msgid "Parent" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_path +msgid "Parent Path" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__serial +msgid "Serial" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__tag_ids +msgid "Tag" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__template_id +msgid "Template" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_input__template_input_id +msgid "Template Input" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_output__template_output_id +msgid "Template Output" +msgstr "" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_template_menu +msgid "Templates" +msgstr "" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__url +msgid "Url" +msgstr "" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Use this URL on your device configuration" +msgstr "" diff --git a/iot_template_oca/i18n/it.po b/iot_template_oca/i18n/it.po new file mode 100644 index 00000000..5f11c573 --- /dev/null +++ b/iot_template_oca/i18n/it.po @@ -0,0 +1,292 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * iot_template_oca +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-05-02 16:37+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_device_configuration_menu +msgid "Add a new Device" +msgstr "Aggiungi nuovo dispositivo" + +#. module: iot_template_oca +#: model:ir.actions.server,name:iot_template_oca.configure_action +msgid "Apply Template" +msgstr "Applica modello" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Apply template" +msgstr "Applica modello" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_function +msgid "Call Function" +msgstr "Richiama funzione" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_model_id +msgid "Call Model" +msgstr "Richiama modello" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Close" +msgstr "Chiudi" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__communication_system_id +msgid "Communication System" +msgstr "Sistema di comunicazione" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Configuration URL" +msgstr "URL configurazione" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_configure +msgid "Configure a IoT device" +msgstr "Configura un dispositivo IoT" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__create_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device_input +msgid "Device input" +msgstr "Input dispositivo" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__display_name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__group_id +msgid "Group" +msgstr "Gruppo" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__id +msgid "ID" +msgstr "ID" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__icon +msgid "Icon" +msgstr "Icona" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1920 +msgid "Image" +msgstr "Immagine" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1024 +msgid "Image 1024" +msgstr "Immagine 1024" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_128 +msgid "Image 128" +msgstr "Immagine 128" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_256 +msgid "Image 256" +msgstr "Immagine 256" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_512 +msgid "Image 512" +msgstr "Immagine 512" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__input_ids +msgid "Input" +msgstr "Input" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Inputs" +msgstr "Input" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_device +#: model:ir.model,name:iot_template_oca.model_iot_device_output +msgid "IoT Device" +msgstr "Dispositivo IoT" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_input +msgid "IoT Input for Template" +msgstr "Input IoT per modello" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_key +msgid "IoT Keys for configuration" +msgstr "Chiavi IoT per configurazione" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template +msgid "IoT Template for Device" +msgstr "Modello IoT per dispositivo" + +#. module: iot_template_oca +#: model:ir.actions.act_window,name:iot_template_oca.iot_template_action +msgid "IoT Templates" +msgstr "Modelli IoT" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__key_ids +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__key +msgid "Key" +msgstr "Chiave" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Keys" +msgstr "Chiavi" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key____last_update +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_uid +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__write_date +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__name +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__name +msgid "Name" +msgstr "Nome" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__output_ids +msgid "Output" +msgstr "Output" + +#. module: iot_template_oca +#: model:ir.model,name:iot_template_oca.model_iot_template_output +msgid "Output templates for IoT" +msgstr "Modello output per IoT" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form +msgid "Outputs" +msgstr "Output" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__params +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__params +msgid "Params" +msgstr "Parametri" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_id +msgid "Parent" +msgstr "Padre" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_path +msgid "Parent Path" +msgstr "Percorso padre" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__serial +msgid "Serial" +msgstr "Seriale" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__tag_ids +msgid "Tag" +msgstr "Etichetta" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_key__template_id +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__template_id +msgid "Template" +msgstr "Modello" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_input__template_input_id +msgid "Template Input" +msgstr "Modello input" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_output__template_output_id +msgid "Template Output" +msgstr "Modello output" + +#. module: iot_template_oca +#: model:ir.ui.menu,name:iot_template_oca.iot_template_menu +msgid "Templates" +msgstr "Modelli" + +#. module: iot_template_oca +#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__url +msgid "Url" +msgstr "URL" + +#. module: iot_template_oca +#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form +msgid "Use this URL on your device configuration" +msgstr "Utilizzare questo URLnella configurazione del dispositivo" diff --git a/iot_template_oca/models/__init__.py b/iot_template_oca/models/__init__.py new file mode 100644 index 00000000..947d0d6d --- /dev/null +++ b/iot_template_oca/models/__init__.py @@ -0,0 +1,4 @@ +from . import iot_device +from . import iot_device_input +from . import iot_device_output +from . import iot_template diff --git a/iot_template_oca/models/iot_device.py b/iot_template_oca/models/iot_device.py new file mode 100644 index 00000000..98b7241b --- /dev/null +++ b/iot_template_oca/models/iot_device.py @@ -0,0 +1,21 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + + +class IotDevice(models.Model): + _inherit = "iot.device" + + def get_iot_configuration(self): + self.ensure_one() + return { + "host": self.env["ir.config_parameter"].sudo().get_param("web.base.url"), + "name": self.name, + "outputs": { + output.name: output.get_configuration() for output in self.output_ids + }, + "inputs": { + iot_input.name: iot_input.get_configuration() + for iot_input in self.input_ids + }, + } diff --git a/iot_template_oca/models/iot_device_input.py b/iot_template_oca/models/iot_device_input.py new file mode 100644 index 00000000..012ad828 --- /dev/null +++ b/iot_template_oca/models/iot_device_input.py @@ -0,0 +1,18 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class IotDeviceInput(models.Model): + _inherit = "iot.device.input" + + template_input_id = fields.Many2one( + "iot.template.input", + readonly=True, + ) + + def get_configuration(self): + return { + "serial": self.serial, + "passphrase": self.passphrase, + } diff --git a/iot_template_oca/models/iot_device_output.py b/iot_template_oca/models/iot_device_output.py new file mode 100644 index 00000000..ca24d6c6 --- /dev/null +++ b/iot_template_oca/models/iot_device_output.py @@ -0,0 +1,15 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class IotDeviceOutput(models.Model): + _inherit = "iot.device.output" + + template_output_id = fields.Many2one( + "iot.template.output", + readonly=True, + ) + + def get_configuration(self): + return {} diff --git a/iot_template_oca/models/iot_template.py b/iot_template_oca/models/iot_template.py new file mode 100644 index 00000000..9f367c5d --- /dev/null +++ b/iot_template_oca/models/iot_template.py @@ -0,0 +1,137 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from uuid import uuid4 + +from jinja2.sandbox import SandboxedEnvironment + +from odoo import fields, models +from odoo.tools.safe_eval import safe_eval + +mako_template_env = SandboxedEnvironment( + block_start_string="<%", + block_end_string="%>", + variable_start_string="${", + variable_end_string="}", + comment_start_string="<%doc>", + comment_end_string="", + line_statement_prefix="%", + line_comment_prefix="##", + trim_blocks=True, # do not output newline after blocks + autoescape=True, # XML/HTML automatic escaping +) + + +class IotTemplate(models.Model): + _name = "iot.template" + _inherit = "image.mixin" + _description = "IoT Template for Device" + _parent_name = "parent_id" + _parent_store = True + _parent_order = "name" + + parent_path = fields.Char(index=True) + name = fields.Char(required=True) + input_ids = fields.One2many( + "iot.template.input", + inverse_name="template_id", + ) + output_ids = fields.One2many( + "iot.template.output", + inverse_name="template_id", + ) + key_ids = fields.One2many("iot.template.key", inverse_name="template_id") + parent_id = fields.Many2one("iot.template", ondelete="restrict") + tag_ids = fields.Many2many("iot.device.tag") + group_id = fields.Many2one("iot.device.group") + icon = fields.Selection( + selection=lambda r: r.env["iot.device"]._fields["icon"].selection + ) + + def _get_keys(self, serial): + if self.parent_id: + keys = self.parent_id._get_keys(serial) + else: + keys = {"serial": serial} + keys.update({key.key: key._generate_value() for key in self.key_ids}) + return keys + + def apply_template(self, device, keys): + self.ensure_one() + new_vals = {} + if self.group_id and not device.group_id: + new_vals["group_id"] = self.group_id.id + if self.tag_ids: + new_vals["tag_ids"] = [(4, tag_id) for tag_id in self.tag_ids.ids] + if self.image_1920 and not device.image_1920: + new_vals["image_1920"] = self.image_1920 + if self.icon and not device.icon: + new_vals["icon"] = self.icon + if new_vals: + device.write(new_vals) + for element in self.input_ids: + element._apply_template(device, keys) + for element in self.output_ids: + element._apply_template(device, keys) + if self.parent_id: + self.parent_id.apply_template(device, keys) + + +class IotTemplateInput(models.Model): + _name = "iot.template.input" + _description = "IoT Input for Template" + + template_id = fields.Many2one("iot.template", required=True) + name = fields.Char(required=True) + params = fields.Text() + call_model_id = fields.Many2one("ir.model") + call_function = fields.Char(required=True) + + def _apply_template(self, device, keys): + real_vals = { + "device_id": device.id, + "name": self.name, + "call_function": self.call_function, + "call_model_id": self.call_model_id.id, + "template_input_id": self.id, + "serial": uuid4(), + "passphrase": uuid4(), + } + vals = safe_eval(self.params) + for key in vals: + vals[key] = mako_template_env.from_string(vals[key]).render(keys) + real_vals.update(vals) + return self.env["iot.device.input"].create(real_vals) + + +class IotTemplateOutput(models.Model): + _name = "iot.template.output" + _description = "Output templates for IoT" + + template_id = fields.Many2one("iot.template", required=True) + name = fields.Char(required=True) + communication_system_id = fields.Many2one("iot.communication.system", required=True) + params = fields.Text() + + def _apply_template(self, device, keys): + real_vals = { + "device_id": device.id, + "name": self.name, + "communication_system_id": self.communication_system_id.id, + "template_output_id": self.id, + } + vals = safe_eval(self.params or "{}") + for key in vals: + vals[key] = mako_template_env.from_string(vals[key]).render(keys) + real_vals.update(vals) + return self.env["iot.device.output"].create(real_vals) + + +class IotTemplateKey(models.Model): + _name = "iot.template.key" + _description = "IoT Keys for configuration" + + template_id = fields.Many2one("iot.template", required=True) + key = fields.Char(required=True) + + def _generate_value(self): + return uuid4() diff --git a/iot_template_oca/pyproject.toml b/iot_template_oca/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/iot_template_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/iot_template_oca/readme/CONTRIBUTORS.md b/iot_template_oca/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..c59153af --- /dev/null +++ b/iot_template_oca/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Enric Tobella \<\> diff --git a/iot_template_oca/readme/DESCRIPTION.md b/iot_template_oca/readme/DESCRIPTION.md new file mode 100644 index 00000000..50979b3b --- /dev/null +++ b/iot_template_oca/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +Create a system of templates for IoT devices. + +When we are using a template we can configure a device with a simple URL +configuration. The device will contact odoo and send the template name. +Odoo will create the device and respond with all the expected data. diff --git a/iot_template_oca/readme/USAGE.md b/iot_template_oca/readme/USAGE.md new file mode 100644 index 00000000..1c89b232 --- /dev/null +++ b/iot_template_oca/readme/USAGE.md @@ -0,0 +1,6 @@ +1. Create a template with a module or in Iot \> Templates +2. Access Iot \> Config Device +3. Confirm that you want to configurate a new device +4. Copy the URL +5. Access the device and send it the configuration url +6. The device will contact odoo and automatically configure itself. diff --git a/iot_template_oca/security/ir.model.access.csv b/iot_template_oca/security/ir.model.access.csv new file mode 100644 index 00000000..0405b81b --- /dev/null +++ b/iot_template_oca/security/ir.model.access.csv @@ -0,0 +1,10 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_iot_template,access_iot_template,model_iot_template,iot_oca.group_iot_user,1,0,0,0 +manage_iot_template,access_iot_template,model_iot_template,iot_oca.group_iot_manager,1,1,1,1 +access_iot_template_input,access_iot_template_input,model_iot_template_input,iot_oca.group_iot_user,1,0,0,0 +manage_iot_template_input,access_iot_template_input,model_iot_template_input,iot_oca.group_iot_manager,1,1,1,1 +access_iot_template_output,access_iot_template_output,model_iot_template_output,iot_oca.group_iot_user,1,0,0,0 +manage_iot_template_output,access_iot_template_output,model_iot_template_output,iot_oca.group_iot_manager,1,1,1,1 +access_iot_template_key,access_iot_template_key,model_iot_template_key,iot_oca.group_iot_user,1,0,0,0 +manage_iot_template_key,access_iot_template_key,model_iot_template_key,iot_oca.group_iot_manager,1,1,1,1 +access_iot_device_configure,access_iot_device_configure,model_iot_device_configure,iot_oca.group_iot_manager,1,1,1,1 diff --git a/iot_template_oca/static/description/icon.png b/iot_template_oca/static/description/icon.png new file mode 100644 index 00000000..da43f6f0 Binary files /dev/null and b/iot_template_oca/static/description/icon.png differ diff --git a/iot_template_oca/static/description/index.html b/iot_template_oca/static/description/index.html new file mode 100644 index 00000000..5c94f741 --- /dev/null +++ b/iot_template_oca/static/description/index.html @@ -0,0 +1,438 @@ + + + + + +IoT Templates + + + +
+

IoT Templates

+ + +

Beta License: AGPL-3 OCA/iot Translate me on Weblate Try me on Runboat

+

Create a system of templates for IoT devices.

+

When we are using a template we can configure a device with a simple URL +configuration. The device will contact odoo and send the template name. +Odoo will create the device and respond with all the expected data.

+

Table of contents

+ +
+

Usage

+
    +
  1. Create a template with a module or in Iot > Templates
  2. +
  3. Access Iot > Config Device
  4. +
  5. Confirm that you want to configurate a new device
  6. +
  7. Copy the URL
  8. +
  9. Access the device and send it the configuration url
  10. +
  11. The device will contact odoo and automatically configure itself.
  12. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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

+

This module is part of the OCA/iot project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/iot_template_oca/tests/__init__.py b/iot_template_oca/tests/__init__.py new file mode 100644 index 00000000..c6ac672f --- /dev/null +++ b/iot_template_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_iot_template diff --git a/iot_template_oca/tests/test_iot_template.py b/iot_template_oca/tests/test_iot_template.py new file mode 100644 index 00000000..17f98898 --- /dev/null +++ b/iot_template_oca/tests/test_iot_template.py @@ -0,0 +1,141 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.exceptions import UserError +from odoo.tests.common import HttpCase + + +class TestIotTemplate(HttpCase): + def setUp(self): + super().setUp() + self.system = self.env["iot.communication.system"].create({"name": "Testing"}) + self.system_2 = self.env["iot.communication.system"].create( + {"name": "Testing 2"} + ) + self.parent_template = self.env["iot.template"].create( + { + "name": "Parent template", + "key_ids": [(0, 0, {"key": "passphrase"})], + "input_ids": [ + ( + 0, + 0, + { + "name": "INPUT 1", + "call_model_id": False, + "call_function": "iot_ras_default_action", + "params": "{'serial': '${serial}', " + "'passphrase': '${passphrase}'}", + }, + ) + ], + "output_ids": [ + ( + 0, + 0, + {"name": "OUTPUT 1", "communication_system_id": self.system.id}, + ) + ], + } + ) + self.template = self.env["iot.template"].create( + { + "name": "template", + "parent_id": self.parent_template.id, + "key_ids": [(0, 0, {"key": "serial2"})], + "input_ids": [ + ( + 0, + 0, + { + "name": "INPUT 2", + "call_model_id": False, + "call_function": "iot_ras_default_action", + "params": "{'serial': '${serial2}', " + "'passphrase': '${passphrase}'}", + }, + ) + ], + "output_ids": [ + ( + 0, + 0, + { + "name": "OUTPUT 2", + "communication_system_id": self.system_2.id, + "params": "{'ip': '1234'}", + }, + ) + ], + } + ) + + def _get_wizard(self): + wizard = self.env["iot.device.configure"].create({}) + self.assertTrue(wizard.serial) + self.assertTrue(wizard.url) + return wizard + + def test_generation(self): + wizard = self._get_wizard() + device_config = self.url_open( + wizard.url, data={"template": self.template.name} + ).json() + device = self.env["iot.device"].search([("name", "=", device_config["name"])]) + self.assertTrue(device) + self.assertEqual(1, len(device)) + self.assertEqual(2, len(device.output_ids)) + self.assertEqual(2, len(device.input_ids)) + input1 = device.input_ids.filtered( + lambda r: r.template_input_id == self.parent_template.input_ids + ) + self.assertTrue(input1) + input2 = device.input_ids.filtered( + lambda r: r.template_input_id == self.template.input_ids + ) + self.assertTrue(input2) + self.assertNotEqual(input1, input2) + self.assertGreater(len(input1.passphrase), 0) + self.assertGreater(len(input2.passphrase), 0) + self.assertEqual(input1.passphrase, input2.passphrase) + self.assertGreater(len(input1.serial), 0) + self.assertGreater(len(input2.serial), 0) + self.assertNotEqual(input1.serial, input2.serial) + output1 = device.output_ids.filtered( + lambda r: r.template_output_id == self.parent_template.output_ids + ) + self.assertTrue(output1) + output2 = device.output_ids.filtered( + lambda r: r.template_output_id == self.template.output_ids + ) + self.assertTrue(output2) + self.assertNotEqual(output1, output2) + self.assertEqual(output1.communication_system_id, self.system) + self.assertFalse(output1.ip) + self.assertEqual(output2.communication_system_id, self.system_2) + self.assertEqual(output2.ip, "1234") + + def test_missing_configuration(self): + wizard = self._get_wizard() + url = wizard.url.replace(wizard.serial, wizard.serial + wizard.serial) + device_config = self.url_open(url, data={"template": self.template.name}).json() + self.assertFalse(device_config) + + def test_no_double_configuration(self): + """ + We expect that it is not allowed to do the same call twice, + the first it must work properly. + No result should be returned on the second one + """ + wizard = self._get_wizard() + url = wizard.url + device_config = self.url_open(url, data={"template": self.template.name}).json() + self.assertTrue(device_config) + device = self.env["iot.device"].search([("name", "=", device_config["name"])]) + self.assertTrue(device) + device_config = self.url_open(url, data={"template": self.template.name}).json() + self.assertFalse(device_config) + + def test_constrain_hierarchy(self): + with self.assertRaises(UserError): + self.parent_template.parent_id = self.template diff --git a/iot_template_oca/views/iot_template_views.xml b/iot_template_oca/views/iot_template_views.xml new file mode 100644 index 00000000..a53e3d5e --- /dev/null +++ b/iot_template_oca/views/iot_template_views.xml @@ -0,0 +1,109 @@ + + + + iot.template.form + iot.template + +
+
+ +
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
+ + + + + + +
+ + + + + + + +
+
+
+
+ + +
+ + + iot.template.form + iot.template + + + + + + + + IoT Templates + ir.actions.act_window + iot.template + tree,form + + + diff --git a/iot_template_oca/wizards/__init__.py b/iot_template_oca/wizards/__init__.py new file mode 100644 index 00000000..e77c356e --- /dev/null +++ b/iot_template_oca/wizards/__init__.py @@ -0,0 +1 @@ +from . import iot_device_configure diff --git a/iot_template_oca/wizards/iot_device_configure.py b/iot_template_oca/wizards/iot_device_configure.py new file mode 100644 index 00000000..c0844176 --- /dev/null +++ b/iot_template_oca/wizards/iot_device_configure.py @@ -0,0 +1,35 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from uuid import uuid4 + +from odoo import api, fields, models + + +class IotDeviceConfigure(models.TransientModel): + _name = "iot.device.configure" + _description = "Configure a IoT device" + + serial = fields.Char(readonly=True, required=True, default=lambda r: uuid4()) + url = fields.Char(compute="_compute_url") + + @api.depends("serial") + def _compute_url(self): + for record in self: + record.url = ( + self.env["ir.config_parameter"].sudo().get_param("web.base.url") + + "/iot/" + + record.serial + + "/configure" + ) + + @api.model + def configure(self, serial, template_id, ip=False, **kwargs): + config = self.search([("serial", "=", serial)]) + if not config: + return {} + config.unlink() + device = self.env["iot.device"].create({"name": serial, "ip": ip}) + template = self.env["iot.template"].search([("name", "=", template_id)]) + if template: + template.apply_template(device, template._get_keys(serial)) + return device.get_iot_configuration() diff --git a/iot_template_oca/wizards/iot_device_configure.xml b/iot_template_oca/wizards/iot_device_configure.xml new file mode 100644 index 00000000..cfff1d72 --- /dev/null +++ b/iot_template_oca/wizards/iot_device_configure.xml @@ -0,0 +1,45 @@ + + + + + iot.device.configure + iot.device.configure + form + +
+
+ Use this URL on your device configuration +
+ + + +
+
+
+
+
+ + Apply Template + + code + action = model.create({}).get_formview_action() +action["target"] = "new" + + +