michel_coworking/coworking_relation/models/relation.py

24 lines
762 B
Python

# -*- 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'
name = fields.Char()
coworker1 = fields.Many2one(
'coworking.coworker', 'Coworker', index=True, required=True,
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
)
coworker2 = fields.Many2one(
'coworking.coworker', 'Coworker', index=True, required=True,
domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]"
)
relation = fields.Char(index=True, required=True)