Coworking/coworking_relation/models/coworker_relation.py

44 lines
1.3 KiB
Python

# -*- coding: utf-8 -*-
""" Coworker relation """
from odoo import models, fields, api, _
class coworker_relation(models.Model):
""" Coworker relation """
inherit = 'coworking.coworker'
_name = 'coworking.coworker_relation'
_description = 'coworker_relation model definition'
# coworker1 = fields.Many2one(
# string="coworker1",
# # comodel_name="res.partner",
# # domain="[('field', '=', other)]",
# # context={"key": "value"},
# # ondelete="set null",
# # help="Explain your field.",
# index=True,
# requiered=True
# )
#
# coworker2 = fields.Many2one(
# string="coworker2",
# # comodel_name="res.partner",
# # domain="[('field', '=', other)]",
# # context={"key": "value"},
# # ondelete="set null",
# # help="Explain your field.",
# index=True,
# requiered=True
# )
#
# relation = fields.Char(requiered=True, index=True)
#
#
# @api.constrains('coworker1', 'coworker2')
# def _check_coworker_is_same(self):
# """test si les coworkers ne sont pas identiques"""
# for coworker_relation in self:
# if self.coworker1 == self.coworker2:
# raise models.ValidationError(_('coworker1 is the same of coworker2'))