[ADD] maintenance_user_ssh_key: create add-on
This commit is contained in:
2
maintenance_user_ssh_key/models/__init__.py
Normal file
2
maintenance_user_ssh_key/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import ssh_key
|
||||
from . import res_users
|
||||
14
maintenance_user_ssh_key/models/res_users.py
Normal file
14
maintenance_user_ssh_key/models/res_users.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright 2026 Stéphan Sainléger (Elabore)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = "res.users"
|
||||
|
||||
ssh_key_ids = fields.One2many(
|
||||
comodel_name="ssh.key",
|
||||
inverse_name="user_id",
|
||||
string="SSH Keys",
|
||||
)
|
||||
18
maintenance_user_ssh_key/models/ssh_key.py
Normal file
18
maintenance_user_ssh_key/models/ssh_key.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2026 Stéphan Sainléger (Elabore)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SshKey(models.Model):
|
||||
_name = "ssh.key"
|
||||
_description = "SSH Key"
|
||||
|
||||
key = fields.Text(string="Public Key", required=True)
|
||||
user_id = fields.Many2one(
|
||||
comodel_name="res.users",
|
||||
string="User",
|
||||
required=True,
|
||||
ondelete="cascade",
|
||||
index=True,
|
||||
)
|
||||
Reference in New Issue
Block a user