diff --git a/coworking_coworker/__init__.py b/__init__.py similarity index 100% rename from coworking_coworker/__init__.py rename to __init__.py diff --git a/coworking_base/__manifest__.py b/__manifest__.py similarity index 83% rename from coworking_base/__manifest__.py rename to __manifest__.py index 868b689..87c735d 100644 --- a/coworking_base/__manifest__.py +++ b/__manifest__.py @@ -16,14 +16,16 @@ # along with this program. If not, see . { - 'name': 'Coworking base', + 'name': 'Coworking', 'summary': 'yaltik coworking module simplify your coworking gerance', 'description': """ yaltik coworking module simplify your coworking gerance """, 'version': '10.0.0.0.1', - 'category': 'Coworking', + 'category': 'Useless', 'author': 'Yaltik', 'license': 'AGPL-3', 'application': False, 'installable': True, + 'data': ['views/coworking_menu.xml', 'views/coworker_views.xml', + 'security/ir.model.access.csv', 'views/event_menu.xml', 'views/event_views.xml'], 'depends': ['base'] } diff --git a/coworking_app/__init__.py b/coworking_app/__init__.py deleted file mode 100644 index 40a96af..0000000 --- a/coworking_app/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/coworking_app/__manifest__.py b/coworking_app/__manifest__.py deleted file mode 100644 index 3a363af..0000000 --- a/coworking_app/__manifest__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- 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 whole Application', - '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': True, - 'installable': True, - 'data': [], - 'depends': ['coworking_coworker', 'coworking_event'] -} diff --git a/coworking_base/__init__.py b/coworking_base/__init__.py deleted file mode 100644 index 40a96af..0000000 --- a/coworking_base/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/coworking_coworker/__manifest__.py b/coworking_coworker/__manifest__.py deleted file mode 100644 index 5050e10..0000000 --- a/coworking_coworker/__manifest__.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- 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', - '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/coworking_menu.xml', - 'views/coworker_views.xml'], - 'depends': ['coworking_base'] -} diff --git a/coworking_event/__init__.py b/coworking_event/__init__.py deleted file mode 100644 index cde864b..0000000 --- a/coworking_event/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import models diff --git a/coworking_event/__manifest__.py b/coworking_event/__manifest__.py deleted file mode 100644 index 3d9e548..0000000 --- a/coworking_event/__manifest__.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- 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 event', - '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/event_menu.xml', - 'views/event_views.xml', - 'views/coworker_views.xml'], - 'depends': ['coworking_coworker'] -} diff --git a/coworking_event/models/__init__.py b/coworking_event/models/__init__.py deleted file mode 100644 index e57763e..0000000 --- a/coworking_event/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- -"""dd""" -from . import event, coworker diff --git a/coworking_event/models/coworker.py b/coworking_event/models/coworker.py deleted file mode 100644 index f556f3d..0000000 --- a/coworking_event/models/coworker.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -""" Coworker adaptations """ - -from odoo import models, fields, api - -class Coworker(models.Model): - """ Coworker adaptations """ - _inherit = 'coworking.coworker' - - manager_event_ids = fields.One2many('coworking.event', 'manager_id', - string='Events managed') - event_ids = fields.Many2many('coworking.event', string='Events visited') - - events_coworker_count = fields.Integer('Number of event have participe', - compute='_compute_events_coworker_count') - - @api.depends('event_ids') - def _compute_events_coworker_count(self): - """ Computes number of event coworker """ - for event in self: - event.events_coworker_count = len(event.event_ids) diff --git a/coworking_event/security/ir.model.access.csv b/coworking_event/security/ir.model.access.csv deleted file mode 100644 index 8996eec..0000000 --- a/coworking_event/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -acess_coworker_group_user,Access COWORKER Member User,model_coworking_event,base.group_user,1,1,1,1 diff --git a/coworking_event/views/coworker_views.xml b/coworking_event/views/coworker_views.xml deleted file mode 100644 index 68f5668..0000000 --- a/coworking_event/views/coworker_views.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Coworker Form adaptations - coworking.coworker - - - - - - - - - - - - - - - diff --git a/coworking_coworker/models/__init__.py b/models/__init__.py similarity index 61% rename from coworking_coworker/models/__init__.py rename to models/__init__.py index 4e351f4..7f37d89 100644 --- a/coworking_coworker/models/__init__.py +++ b/models/__init__.py @@ -1,2 +1,4 @@ # -*- coding: utf-8 -*- +"""dd""" from . import coworker +from . import event diff --git a/coworking_coworker/models/coworker.py b/models/coworker.py similarity index 81% rename from coworking_coworker/models/coworker.py rename to models/coworker.py index 7852413..87e0b63 100644 --- a/coworking_coworker/models/coworker.py +++ b/models/coworker.py @@ -42,6 +42,22 @@ class Coworker(models.Model): is_done = fields.Boolean('Done?') is_active = fields.Boolean('Active?', default=True) +# Event fields + manager_event_ids = fields.One2many('coworking.event', 'manager_id', + string='Events managed') + event_ids = fields.Many2many('coworking.event', string='Events visited') + + events_coworker_count = fields.Integer('Number of event have participe', + compute='_compute_events_coworker_count') + + + @api.depends('event_ids') + def _compute_events_coworker_count(self): + """ Computes number of event coworker """ + for event in self: + event.events_coworker_count = len(event.event_ids) + + @api.depends('name', 'firstname') def _compute_full_name(self): """Concaténation du nom et du prénom""" diff --git a/coworking_event/models/event.py b/models/event.py similarity index 100% rename from coworking_event/models/event.py rename to models/event.py diff --git a/coworking_coworker/security/ir.model.access.csv b/security/ir.model.access.csv similarity index 75% rename from coworking_coworker/security/ir.model.access.csv rename to security/ir.model.access.csv index 89f9993..7b1f30b 100644 --- a/coworking_coworker/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,3 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink acess_coworker_group_user,Access COWORKER Member User,model_coworking_coworker,base.group_user,1,1,1,0 acess_coworker_group_manager,Access COWORKER Member Manager,model_coworking_coworker,base.group_partner_manager,1,1,1,1 +acess_coworker_group_user,Access COWORKER Member User,model_coworking_event,base.group_user,1,1,1,1 diff --git a/coworking_coworker/views/coworker_views.xml b/views/coworker_views.xml similarity index 92% rename from coworking_coworker/views/coworker_views.xml rename to views/coworker_views.xml index 69024f4..91ff0bd 100644 --- a/coworking_coworker/views/coworker_views.xml +++ b/views/coworker_views.xml @@ -37,6 +37,14 @@ + + + + + + + diff --git a/coworking_coworker/views/coworking_menu.xml b/views/coworking_menu.xml similarity index 100% rename from coworking_coworker/views/coworking_menu.xml rename to views/coworking_menu.xml diff --git a/coworking_event/views/event_menu.xml b/views/event_menu.xml similarity index 100% rename from coworking_event/views/event_menu.xml rename to views/event_menu.xml diff --git a/coworking_event/views/event_views.xml b/views/event_views.xml similarity index 100% rename from coworking_event/views/event_views.xml rename to views/event_views.xml