diff --git a/coworking_app/__init__.py b/coworking_app/__init__.py index 40a96af..cde864b 100644 --- a/coworking_app/__init__.py +++ b/coworking_app/__init__.py @@ -1 +1,3 @@ # -*- coding: utf-8 -*- + +from . import models diff --git a/coworking_app/__manifest__.py b/coworking_app/__manifest__.py index 3a363af..87c735d 100644 --- a/coworking_app/__manifest__.py +++ b/coworking_app/__manifest__.py @@ -16,15 +16,16 @@ # along with this program. If not, see . { - 'name': 'Coworking whole Application', + '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': True, + 'application': False, 'installable': True, - 'data': [], - 'depends': ['coworking_coworker', 'coworking_event'] + '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_base/__init__.py b/coworking_base/__init__.py index 40a96af..cde864b 100644 --- a/coworking_base/__init__.py +++ b/coworking_base/__init__.py @@ -1 +1,3 @@ # -*- coding: utf-8 -*- + +from . import models diff --git a/coworking_base/__manifest__.py b/coworking_base/__manifest__.py index 868b689..87c735d 100644 --- a/coworking_base/__manifest__.py +++ b/coworking_base/__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_coworker/__manifest__.py b/coworking_coworker/__manifest__.py index 5050e10..87c735d 100644 --- a/coworking_coworker/__manifest__.py +++ b/coworking_coworker/__manifest__.py @@ -16,17 +16,16 @@ # along with this program. If not, see . { - 'name': 'Coworking coworker', + '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': ['security/ir.model.access.csv', - 'views/coworking_menu.xml', - 'views/coworker_views.xml'], - 'depends': ['coworking_base'] + '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_coworker/models/__init__.py b/coworking_coworker/models/__init__.py index 4e351f4..7f37d89 100644 --- a/coworking_coworker/models/__init__.py +++ b/coworking_coworker/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/coworking_coworker/models/coworker.py index 7852413..87e0b63 100644 --- a/coworking_coworker/models/coworker.py +++ b/coworking_coworker/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_coworker/security/ir.model.access.csv b/coworking_coworker/security/ir.model.access.csv index 89f9993..7b1f30b 100644 --- a/coworking_coworker/security/ir.model.access.csv +++ b/coworking_coworker/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/coworking_coworker/views/coworker_views.xml index 69024f4..91ff0bd 100644 --- a/coworking_coworker/views/coworker_views.xml +++ b/coworking_coworker/views/coworker_views.xml @@ -37,6 +37,14 @@ + + + + + + + diff --git a/coworking_event/__manifest__.py b/coworking_event/__manifest__.py index 3d9e548..87c735d 100644 --- a/coworking_event/__manifest__.py +++ b/coworking_event/__manifest__.py @@ -16,18 +16,16 @@ # along with this program. If not, see . { - 'name': 'Coworking event', + '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': ['security/ir.model.access.csv', - 'views/event_menu.xml', - 'views/event_views.xml', - 'views/coworker_views.xml'], - 'depends': ['coworking_coworker'] + '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_event/models/__init__.py b/coworking_event/models/__init__.py index e57763e..7f37d89 100644 --- a/coworking_event/models/__init__.py +++ b/coworking_event/models/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- """dd""" -from . import event, coworker +from . import coworker +from . import event 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 index 8996eec..7b1f30b 100644 --- a/coworking_event/security/ir.model.access.csv +++ b/coworking_event/security/ir.model.access.csv @@ -1,2 +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_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 - - - - - - - - - - - - - - -