Move 7 IoT modules to oca-ocb-hw and 9 product modules to oca-product

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ernad Husremovic 2025-08-30 17:53:33 +02:00
parent e4803a70af
commit b1d16a46bf
292 changed files with 19657 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# Copyright 2019 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_keys(self, serial_of_input, type_of_key):
iot_input = self.env["iot.device.input"].search(
[("serial", "=", serial_of_input)], limit=1
)
if iot_input:
if iot_input.lock_id:
domain = []
if type_of_key != "ALL":
domain.append(("key_type", "=", type_of_key))
return {"keys": iot_input.lock_id.get_virtual_keys(domain)}
return {"error": "no input found"}
def write(self, vals):
if vals.get("name", False):
for device in self:
for device_input in device.input_ids:
if device_input.lock_id:
input_name = device_input.name
device_input.lock_id.write(
{"name": vals.get("name") + " / " + input_name}
)
return super().write(vals)