2017-11-16 15:47:18 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
""" Coworker relation """
|
|
|
|
|
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
|
|
class CoworkerRelation(models.Model):
|
|
|
|
"""Coworker relation model """
|
|
|
|
_name = 'coworking.relation'
|
|
|
|
_description = 'relation model definition'
|
|
|
|
_order = 'id asc'
|
2017-11-16 16:02:30 +01:00
|
|
|
|
2017-11-16 16:37:46 +01:00
|
|
|
name = fields.Char()
|
|
|
|
|
|
|
|
coworker1 = fields.Many2one(
|
2017-11-16 16:38:21 +01:00
|
|
|
'coworking.coworker', 'Coworker1', index=True, required=True,
|
2017-11-16 16:37:46 +01:00
|
|
|
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
|
|
|
|
)
|
|
|
|
coworker2 = fields.Many2one(
|
2017-11-16 16:38:21 +01:00
|
|
|
'coworking.coworker', 'Coworker2', index=True, required=True,
|
2017-11-16 16:37:46 +01:00
|
|
|
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
|
|
|
|
)
|
|
|
|
relation = fields.Char(index=True, required=True)
|