[WIP] Refactoring Groups

This commit is contained in:
Pablo
2018-11-07 10:29:12 +01:00
parent a0efa1031e
commit 2747846c1b
6 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
# Copyright 2018 Pablo Q. Barriuso
# Copyright 2018 Alexandre Díaz
# Copyright 2018 Dario Lodeiros
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import models, fields, api, _
_logger = logging.getLogger(__name__)
class HotelNodeGroupRemote(models.Model):
_name = "hotel.node.group.remote"
_description = "Remote Access Groups IDs"
node_id = fields.Many2one('project.project', 'Hotel', required=True)
group_id = fields.Many2one('hotel.node.group', 'Group', require=True)
name = fields.Char(related='group_id.name')
remote_group_id = fields.Integer(require=True, copy=False, readonly=True,
help="ID of the target record in the remote database")
_sql_constraints = [
('node_remote_group_id_uniq', 'unique (node_id, remote_group_id)',
'The remote identifier of the group must be unique within a Node!')
]