forked from michel/Coworking
Add module coworker_relation
This commit is contained in:
parent
20ade01c56
commit
5b7ac167cb
3
coworking_relation/__init__.py
Normal file
3
coworking_relation/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
31
coworking_relation/__manifest__.py
Normal file
31
coworking_relation/__manifest__.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2017 Firstname Lastname <firstname.lastname@company.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
{
|
||||||
|
'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']
|
||||||
|
}
|
3
coworking_relation/models/__init__.py
Normal file
3
coworking_relation/models/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""dd"""
|
||||||
|
from . import coworker_relation, coworker
|
43
coworking_relation/models/coworker_relation.py
Normal file
43
coworking_relation/models/coworker_relation.py
Normal file
@ -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'))
|
22
coworking_relation/views/coworker_relation_views.xml
Normal file
22
coworking_relation/views/coworker_relation_views.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
<!-- Form -->
|
||||||
|
<record id="view_form_coworker_relation" model="ir.ui.view">
|
||||||
|
<field name="name">coworker_relation Form</field>
|
||||||
|
<field name="model">coworking.relation</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="coworker_relation">
|
||||||
|
<sheet>
|
||||||
|
<group name="group_top">
|
||||||
|
<group name="group_left">
|
||||||
|
<field name="coworker1" />
|
||||||
|
<field name="coworker2" />
|
||||||
|
<field name="relation" />
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
Loading…
Reference in New Issue
Block a user