Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,92 @@
=============
IoT Templates
=============
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fc16a291813bfa9f574daf5a7d8f44ebc8ea2b4b22ea7446a45928e6094c0cf2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.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-16-0/iot-16-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=16.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 <https://github.com/OCA/iot/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/iot/issues/new?body=module:%20iot_template_oca%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Creu Blanca
Contributors
~~~~~~~~~~~~
* Enric Tobella <etobella@creublanca.es>
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 <https://github.com/OCA/iot/tree/16.0/iot_template_oca>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,3 @@
from . import controller
from . import models
from . import wizards

View file

@ -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": "16.0.1.0.1",
"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"],
}

View file

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

View file

@ -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/<serial>/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)
)

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="demo_template" model="iot.template">
<field name="name">demo_template</field>
</record>
<record id="demo_template_serial" model="iot.template.key">
<field name="template_id" ref="demo_template" />
<field name="key">serial</field>
</record>
<record id="demo_template_input" model="iot.template.input">
<field name="template_id" ref="demo_template" />
<field name="name">demo_input</field>
<field name="call_model_id" eval="False" />
<field name="call_function">test_input_device</field>
<field name="params">{}</field>
</record>
</odoo>

View file

@ -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 "Dodaj novi uređaj"
#. module: iot_template_oca
#: model:ir.actions.server,name:iot_template_oca.configure_action
msgid "Apply Template"
msgstr "Primijeni predložak"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form
msgid "Apply template"
msgstr "Primijeni template"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_function
msgid "Call Function"
msgstr "Pozovi funkciju"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_input__call_model_id
msgid "Call Model"
msgstr "Pozovi model"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form
msgid "Close"
msgstr "Zatvori"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template_output__communication_system_id
msgid "Communication System"
msgstr "Komunikacijski sistem"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.configure_form
msgid "Configuration URL"
msgstr "URL za konfiguraciju"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_device_configure
msgid "Configure a IoT device"
msgstr "Konfigurišite IoT uređaj"
#. 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 "Kreirao"
#. 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 "Kreirano"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_device_input
msgid "Device input"
msgstr "Ulaz uređaja"
#. 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 "Prikazani naziv"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__group_id
msgid "Group"
msgstr "Grupa"
#. 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 "Ikona"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1920
msgid "Image"
msgstr "Slika"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_1024
msgid "Image 1024"
msgstr "Slika 1024"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_128
msgid "Image 128"
msgstr "Slika 128"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_256
msgid "Image 256"
msgstr "Slika 256"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__image_512
msgid "Image 512"
msgstr "Slika 512"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__input_ids
msgid "Input"
msgstr "Ulaz"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form
msgid "Inputs"
msgstr "Ulazi"
#. 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 "IoT uređaj"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_template_input
msgid "IoT Input for Template"
msgstr "IoT ulaz za predložak"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_template_key
msgid "IoT Keys for configuration"
msgstr "IoT ključevi za konfiguraciju"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_template
msgid "IoT Template for Device"
msgstr "IoT predložak za uređaj"
#. module: iot_template_oca
#: model:ir.actions.act_window,name:iot_template_oca.iot_template_action
msgid "IoT Templates"
msgstr "IoT predlošci"
#. 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 "Ključ"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form
msgid "Keys"
msgstr "Ključevi"
#. 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 "Zadnje mijenjano"
#. 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 "Zadnji ažurirao"
#. 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 "Zadnje ažurirano"
#. 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 "Naziv:"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__output_ids
msgid "Output"
msgstr "Izlaz"
#. module: iot_template_oca
#: model:ir.model,name:iot_template_oca.model_iot_template_output
msgid "Output templates for IoT"
msgstr "Izlazni predlošci za IoT"
#. module: iot_template_oca
#: model_terms:ir.ui.view,arch_db:iot_template_oca.iot_template_form
msgid "Outputs"
msgstr "Izlazi"
#. 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 "Nasljeđeni"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__parent_path
msgid "Parent Path"
msgstr "Putanja nadređenih"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_configure__serial
msgid "Serial"
msgstr "Serijski broj"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_template__tag_ids
msgid "Tag"
msgstr "Oznaka"
#. 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 "Prijedlog"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_input__template_input_id
msgid "Template Input"
msgstr "Ulaz predloška"
#. module: iot_template_oca
#: model:ir.model.fields,field_description:iot_template_oca.field_iot_device_output__template_output_id
msgid "Template Output"
msgstr "Izlaz predloška"
#. module: iot_template_oca
#: model:ir.ui.menu,name:iot_template_oca.iot_template_menu
msgid "Templates"
msgstr "Predlošci"
#. 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 "Koristi ovaj URL u konfiguraciji vašeg uređaja"

View file

@ -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 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: 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"

View file

@ -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 ""

View file

@ -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 ""

View file

@ -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 <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: 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"

View file

@ -0,0 +1,4 @@
from . import iot_device
from . import iot_device_input
from . import iot_device_output
from . import iot_template

View file

@ -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
},
}

View file

@ -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,
}

View file

@ -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 {}

View file

@ -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="</%doc>",
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, unaccent=False)
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()

View file

@ -0,0 +1 @@
* Enric Tobella <etobella@creublanca.es>

View file

@ -0,0 +1,7 @@
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.

View file

@ -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.

View file

@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_iot_template access_iot_template model_iot_template iot_oca.group_iot_user 1 0 0 0
3 manage_iot_template access_iot_template model_iot_template iot_oca.group_iot_manager 1 1 1 1
4 access_iot_template_input access_iot_template_input model_iot_template_input iot_oca.group_iot_user 1 0 0 0
5 manage_iot_template_input access_iot_template_input model_iot_template_input iot_oca.group_iot_manager 1 1 1 1
6 access_iot_template_output access_iot_template_output model_iot_template_output iot_oca.group_iot_user 1 0 0 0
7 manage_iot_template_output access_iot_template_output model_iot_template_output iot_oca.group_iot_manager 1 1 1 1
8 access_iot_template_key access_iot_template_key model_iot_template_key iot_oca.group_iot_user 1 0 0 0
9 manage_iot_template_key access_iot_template_key model_iot_template_key iot_oca.group_iot_manager 1 1 1 1
10 access_iot_device_configure access_iot_device_configure model_iot_device_configure iot_oca.group_iot_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -0,0 +1,440 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>IoT Templates</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="iot-templates">
<h1 class="title">IoT Templates</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fc16a291813bfa9f574daf5a7d8f44ebc8ea2b4b22ea7446a45928e6094c0cf2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/iot/tree/16.0/iot_template_oca"><img alt="OCA/iot" src="https://img.shields.io/badge/github-OCA%2Fiot-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/iot-16-0/iot-16-0-iot_template_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/iot&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Create a system of templates for IoT devices.</p>
<p>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.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ol class="arabic simple">
<li>Create a template with a module or in <cite>Iot &gt; Templates</cite></li>
<li>Access <cite>Iot &gt; Config Device</cite></li>
<li>Confirm that you want to configurate a new device</li>
<li>Copy the URL</li>
<li>Access the device and send it the configuration url</li>
<li>The device will contact odoo and automatically configure itself.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/iot/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/iot/issues/new?body=module:%20iot_template_oca%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Creu Blanca</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/iot/tree/16.0/iot_template_oca">OCA/iot</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

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

View file

@ -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(TestIotTemplate, self).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

View file

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="iot_template_form" model="ir.ui.view">
<field name="name">iot.template.form</field>
<field name="model">iot.template</field>
<field name="arch" type="xml">
<form create="0">
<header />
<sheet>
<div class="oe_button_box" name="button_box" />
<field
name="image_1920"
widget='image'
class="oe_avatar"
options='{"preview_image": "image_128"}'
/>
<div class="oe_title">
<h1>
<field name="name" />
</h1>
</div>
<group>
<field name="group_id" />
<field name="icon" />
<field
name="tag_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
/>
</group>
<notebook>
<page string="Keys" id="key">
<field name="key_ids">
<tree editable="bottom">
<field name="key" />
</tree>
<form>
<sheet>
<group>
<field name="key" />
</group>
</sheet>
</form>
</field>
</page>
<page string="Inputs" id="input">
<field name="input_ids">
<tree>
<field name="name" />
<field name="call_model_id" />
<field name="call_function" />
</tree>
<form>
<sheet>
<group>
<field name="name" />
<field name="call_model_id" />
<field name="call_function" />
<field name="params" />
</group>
</sheet>
</form>
</field>
</page>
<page string="Outputs" id="output">
<field name="output_ids">
<tree>
<field name="name" />
<field name="communication_system_id" />
</tree>
<form>
<sheet>
<group>
<field name="name" />
<field name="communication_system_id" />
<field name="params" />
</group>
</sheet>
</form>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="iot_template_tree" model="ir.ui.view">
<field name="name">iot.template.form</field>
<field name="model">iot.template</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="iot_template_action">
<field name="name">IoT Templates</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">iot.template</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Templates"
sequence="90"
id="iot_template_menu"
action="iot_template_action"
parent="iot_oca.iot_configuration_menu"
/>
</odoo>

View file

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

View file

@ -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()

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2017 Eficent Business and IT Consulting Services, S.L.
Copyright 2017 Creu Blanca
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
-->
<odoo>
<record model="ir.ui.view" id="configure_form">
<field name="name">iot.device.configure</field>
<field name="model">iot.device.configure</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Apply template">
<div>
Use this URL on your device configuration
</div>
<group>
<field
name="url"
widget="CopyClipboardChar"
label="Configuration URL"
/>
</group>
<footer>
<button string="Close" class="btn-default" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="configure_action" model="ir.actions.server">
<field name="name">Apply Template</field>
<field name="model_id" ref="model_iot_device_configure" />
<field name="state">code</field>
<field name="code">action = model.create({}).get_formview_action()
action["target"] = "new"</field>
</record>
<menuitem
name="Add a new Device"
sequence="1"
id="iot_device_configuration_menu"
action="configure_action"
parent="iot_oca.iot_configuration_menu"
groups="iot_oca.group_iot_manager"
/>
</odoo>