diff --git a/coworking_relation/__init__.py b/coworking_relation/__init__.py new file mode 100644 index 0000000..cde864b --- /dev/null +++ b/coworking_relation/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/coworking_relation/__manifest__.py b/coworking_relation/__manifest__.py new file mode 100644 index 0000000..bb40c4c --- /dev/null +++ b/coworking_relation/__manifest__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017 Firstname Lastname +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +{ + 'name': 'Coworking coworker relation', + 'summary': 'yaltik coworking module simplify your coworking gerance', + 'description': """ yaltik coworking module simplify your coworking gerance """, + 'version': '10.0.0.0.1', + 'category': 'Coworking', + 'author': 'Yaltik', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'data': ['security/ir.model.access.csv', + 'views/coworker_relation_views.xml', 'models/coworker_relation.py'], + 'depends': ['coworking_coworker'] +} diff --git a/coworking_relation/models/__init__.py b/coworking_relation/models/__init__.py new file mode 100644 index 0000000..494e37c --- /dev/null +++ b/coworking_relation/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +"""dd""" +from . import coworker_relation, coworker diff --git a/coworking_relation/models/coworker_relation.py b/coworking_relation/models/coworker_relation.py new file mode 100644 index 0000000..ccb8a38 --- /dev/null +++ b/coworking_relation/models/coworker_relation.py @@ -0,0 +1,43 @@ +# -*- 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')) diff --git a/coworking_relation/views/coworker_relation_views.xml b/coworking_relation/views/coworker_relation_views.xml new file mode 100644 index 0000000..99ec96a --- /dev/null +++ b/coworking_relation/views/coworker_relation_views.xml @@ -0,0 +1,22 @@ + + + + + + coworker_relation Form + coworking.relation + +
+ + + + + + + + + +
+
+
+