diff --git a/event_management/README.rst b/event_management/README.rst new file mode 100644 index 000000000..d105581a6 --- /dev/null +++ b/event_management/README.rst @@ -0,0 +1,32 @@ +==================== +Event Management v11 +==================== +Event management is a core module which can manage any type of events. +The user can selectively download and install different service modules to extend the scope of this module. +The new service will be automatically get attached to this core Event management module. +It is different from Odoo's event module. +Here you can manage different types of events and allocate services to different users. + +Note: Presently we have released the service “Event Catering” under this module. New services are being developed by our team. + +Features +======== +* Event order creation. +* Automatically creates service orders. +* Allocate the services to different users. +* Integrated with Accounting module. +* Simple Workflow. +* Attractive Design. + +Contributors +============ + +* Avinash Nk + + +Maintainer +========== + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com \ No newline at end of file diff --git a/event_management/__init__.py b/event_management/__init__.py new file mode 100644 index 000000000..37a8d7aa1 --- /dev/null +++ b/event_management/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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 . +# +################################################################################### +from . import models diff --git a/event_management/__manifest__.py b/event_management/__manifest__.py new file mode 100644 index 000000000..61b8c0b77 --- /dev/null +++ b/event_management/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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': 'Event Management', + 'version': '11.0.1.0.0', + 'summary': """Core Module for Managing Different Types Of Events.""", + 'description': """Core Module for Managing Different Types Of Events""", + "category": "Industry", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['product', 'account'], + 'data': ['security/event_security.xml', + 'security/ir.model.access.csv', + 'views/event_management_view.xml', + 'views/event_type_view.xml', + 'views/dashboard.xml', + 'data/event_management.xml', + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, +} diff --git a/event_management/data/event_management.xml b/event_management/data/event_management.xml new file mode 100644 index 000000000..f9edf8ad5 --- /dev/null +++ b/event_management/data/event_management.xml @@ -0,0 +1,40 @@ + + + + + + Wedding + + + + Birthday + + + + Family Events + + + + Press Conference + + + + Seminars + + + + Conferences + + + + + Event Order + event.order.sequence + %(day)s/%(month)s/%(year)s + EVE- + 1 + 2 + + + + diff --git a/event_management/models/__init__.py b/event_management/models/__init__.py new file mode 100644 index 000000000..154890087 --- /dev/null +++ b/event_management/models/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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 . +# +################################################################################### +from . import event_management diff --git a/event_management/models/event_management.py b/event_management/models/event_management.py new file mode 100644 index 000000000..ae78b9170 --- /dev/null +++ b/event_management/models/event_management.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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 . +# +################################################################################### +from odoo import models, fields, api, _ +from odoo.exceptions import UserError, ValidationError + + +class EventManagement(models.Model): + _name = 'event.management' + + name = fields.Char(string="Name", readonly=True) + type_of_event = fields.Many2one('event.management.type', string="Type", required=True) + partner_id = fields.Many2one('res.partner', string="Customer", required=True) + date = fields.Date(string="Date", default=fields.Date.today, required=True) + start_date = fields.Datetime(string="Start date", default=lambda self: fields.datetime.now(), required=True) + end_date = fields.Datetime(string="End date", required=True) + service_line = fields.One2many('event.service.line', 'event_id', string="Services") + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('invoice', 'Invoiced'), + ('close', 'Close'), ('cancel', 'Canceled')], string="State", default="draft") + note = fields.Text('Terms and conditions') + price_subtotal = fields.Float(string='Total', compute='sub_total_update', readonly=True, store=True) + image = fields.Binary("Image", attachment=True, + help="This field holds the image used as image for the event, limited to 1080x720px.") + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + invoice_count = fields.Integer(string='# of Invoices') + invoice_ids = fields.Many2many("account.invoice", string='Invoices', copy=False) + pending_invoice = fields.Boolean(string="Invoice Pending", compute='pending_invoice_find') + + @api.multi + @api.depends('service_line', 'service_line.state') + def pending_invoice_find(self): + pending = 0 + for lines in self.service_line: + if lines.invoiced is False and lines.state == "done": + pending = 1 + if pending == 1: + self.pending_invoice = True + else: + self.pending_invoice = False + + @api.multi + @api.depends('service_line', 'service_line.amount') + def sub_total_update(self): + total = 0 + for items in self.service_line: + total += items.amount + self.price_subtotal = total + + @api.model + def create(self, values): + start_date = values['start_date'] + end_date = values['end_date'] + if start_date >= end_date: + raise UserError(_('Start date must be less than End date')) + sequence_code = 'event.order.sequence' + sequence_number = self.env['ir.sequence'].next_by_code(sequence_code) + values['name'] = sequence_number + return super(EventManagement, self).create(values) + + @api.multi + def event_confirm(self): + self.state = "confirm" + + @api.multi + def event_cancel(self): + self.state = "cancel" + + @api.multi + def event_close(self): + pending = 0 + for lines in self.service_line: + if lines.invoiced is False: + pending = 1 + if pending == 1: + raise ValidationError(_('You can close an event only when all services is Done and Invoiced')) + else: + self.state = "close" + + @api.multi + def action_view_invoice_event(self): + invoices = self.mapped('invoice_ids') + action = self.env.ref('account.action_invoice_tree1').read()[0] + if len(invoices) > 1: + action['domain'] = [('id', 'in', invoices.ids)] + elif len(invoices) == 1: + action['views'] = [(self.env.ref('account.invoice_form').id, 'form')] + action['res_id'] = invoices.ids[0] + else: + action = {'type': 'ir.actions.act_window_close'} + return action + + @api.multi + def event_invoice_create(self): + product_line = [] + for lines in self.service_line: + if lines.invoiced is False and lines.state == "done": + product_line.append({'product_id': lines.related_product, 'price_unit': lines.amount}) + lines.invoiced = True + if len(product_line) > 0: + journal_id = self.env['account.invoice'].default_get(['journal_id'])['journal_id'] + company_id = self.env.user.company_id.id + inv_obj = self.env['account.invoice'] + inv_line_obj = self.env['account.invoice.line'] + partner = self.partner_id + inv_data = { + 'name': partner.name, + 'reference': partner.name, + 'account_id': partner.property_account_payable_id.id, + 'partner_id': partner.id, + 'currency_id': self.currency_id.id, + 'journal_id': journal_id, + 'origin': self.name, + 'company_id': company_id, + } + inv_id = inv_obj.create(inv_data) + for records in product_line: + product_id = records['product_id'] + price_unit = records['price_unit'] + if product_id.property_account_income_id.id: + income_account = product_id.property_account_income_id.id + elif product_id.categ_id.property_account_income_categ_id.id: + income_account = product_id.categ_id.property_account_income_categ_id.id + else: + raise UserError( + _('Please define income account for this product: "%s" (id:%d).') % (product_id.name, + product_id.id)) + inv_line_data = { + 'name': self.name, + 'account_id': income_account, + 'price_unit': price_unit, + 'quantity': 1, + 'product_id': product_id.id, + 'invoice_id': inv_id.id, + 'uom_id': product_id.uom_id.id, + } + inv_line_obj.create(inv_line_data) + imd = self.env['ir.model.data'] + action = imd.xmlid_to_object('account.action_invoice_tree1') + list_view_id = imd.xmlid_to_res_id('account.invoice_tree') + form_view_id = imd.xmlid_to_res_id('account.invoice_form') + result = { + 'name': action.name, + 'help': action.help, + 'type': 'ir.actions.act_window', + 'views': [[list_view_id, 'tree'], [form_view_id, 'form'], [False, 'graph'], [False, 'kanban'], + [False, 'calendar'], [False, 'pivot']], + 'target': action.target, + 'context': action.context, + 'res_model': 'account.invoice', + } + if len(inv_id) > 1: + result['domain'] = "[('id','in',%s)]" % inv_id.ids + elif len(inv_id) == 1: + result['views'] = [(form_view_id, 'form')] + result['res_id'] = inv_id.ids[0] + else: + result = {'type': 'ir.actions.act_window_close'} + self.state = "invoice" + all_invoice_ids = self.invoice_ids.ids + all_invoice_ids.append(inv_id.id) + self.update({'invoice_ids': all_invoice_ids, 'invoice_count': self.invoice_count + 1}) + return result + + +class EventServiceLine(models.Model): + _name = 'event.service.line' + + service = fields.Selection([('none', 'None')], string="Services", required=True) + event_id = fields.Many2one('event.management', string="Event") + date_from = fields.Datetime(string="Date from", required=True) + date_to = fields.Datetime(string="Date to", required=True) + amount = fields.Float(string="Amount", readonly=True) + state = fields.Selection([('done', 'Done'), ('pending', 'Pending')], string="State", default="pending", + readonly=True) + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + invoiced = fields.Boolean(string="Invoiced") + related_product = fields.Many2one('product.product', string="Related Product") + + _sql_constraints = [('event_supplier_unique', 'unique(event_id, service)', + 'Duplication Of Service In The Service Lines Is not Allowed')] + + @api.multi + @api.constrains('date_from', 'date_to') + def _check_date_to_date_from(self): + if self.date_to < self.date_from: + raise ValidationError(_('"Date to" cannot be set before "Date from".\n\n' + 'Check the "Date from" and "Date to" of the "%s" service' % self.service)) + + +class EventManagementType(models.Model): + _name = 'event.management.type' + + name = fields.Char(string="Name") + image = fields.Binary("Image", attachment=True, + help="This field holds the image used as image for the event, limited to 1080x720px.") + event_count = fields.Integer(string="# of Events", compute='event_count_calculation') + + @api.multi + def event_count_calculation(self): + for records in self: + events = self.env['event.management'].search([('type_of_event', '=', records.id)]) + records.event_count = len(events) diff --git a/event_management/security/event_security.xml b/event_management/security/event_security.xml new file mode 100644 index 000000000..1635d1bf5 --- /dev/null +++ b/event_management/security/event_security.xml @@ -0,0 +1,17 @@ + + + + + + Event Management + 19 + + + + Event Manager + + + + + + \ No newline at end of file diff --git a/event_management/security/ir.model.access.csv b/event_management/security/ir.model.access.csv new file mode 100644 index 000000000..a3607ac6f --- /dev/null +++ b/event_management/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +event_management_id,event_management,model_event_management,event_management.group_event_manager,1,1,1,1 +event_service_line_id,event_service_line,model_event_service_line,event_management.group_event_manager,1,1,1,1 +event_management_type_id,event_management_type,model_event_management_type,event_management.group_event_manager,1,1,1,1 + diff --git a/event_management/static/description/banner.jpg b/event_management/static/description/banner.jpg new file mode 100644 index 000000000..fde2857f5 Binary files /dev/null and b/event_management/static/description/banner.jpg differ diff --git a/event_management/static/description/cybro_logo.png b/event_management/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/event_management/static/description/cybro_logo.png differ diff --git a/event_management/static/description/event_dashboard.png b/event_management/static/description/event_dashboard.png new file mode 100644 index 000000000..581b77fe7 Binary files /dev/null and b/event_management/static/description/event_dashboard.png differ diff --git a/event_management/static/description/event_order.png b/event_management/static/description/event_order.png new file mode 100644 index 000000000..ccd7f59f7 Binary files /dev/null and b/event_management/static/description/event_order.png differ diff --git a/event_management/static/description/event_order_creation.gif b/event_management/static/description/event_order_creation.gif new file mode 100644 index 000000000..903a6220e Binary files /dev/null and b/event_management/static/description/event_order_creation.gif differ diff --git a/event_management/static/description/event_order_form.png b/event_management/static/description/event_order_form.png new file mode 100644 index 000000000..15e44e868 Binary files /dev/null and b/event_management/static/description/event_order_form.png differ diff --git a/event_management/static/description/event_type.png b/event_management/static/description/event_type.png new file mode 100644 index 000000000..b9b4ba60c Binary files /dev/null and b/event_management/static/description/event_type.png differ diff --git a/event_management/static/description/icon.png b/event_management/static/description/icon.png new file mode 100644 index 000000000..3c0a67266 Binary files /dev/null and b/event_management/static/description/icon.png differ diff --git a/event_management/static/description/index.html b/event_management/static/description/index.html new file mode 100644 index 000000000..bae8439e8 --- /dev/null +++ b/event_management/static/description/index.html @@ -0,0 +1,369 @@ +
+
+

+ Event Management +

+

+ Core Module for Event Management. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies
+
+
+
+ +
+
+

+ Overview +

+

+ Event management is a core module which can manage any type of events. The user can selectively download and install different service modules to extend the scope of this module. The new service will be automatically get attached to this core Event management module. It is different from Odoo's event module. Here you can manage different types of events and allocate services to different users. + Note: Presently we have released the service 'Event Catering' under this module. New services are being developed by our team. +

+
+
+
+
+

+ Features +

+

+ + Event order creation. +

+

+ + Automatically creates service orders. +

+

+ + Allocate the services to different users. +

+

+ + Integrated with Accounting module. +

+

+ + Simple Workflow. +

+

+ + Attractive Design. +

+
+
+
+
+

+ Screenshots +

+

+ + Event Dashboard +

+
+ +
+

+ + Event Order View +

+
+ +
+

+ + Event Order Form View +

+
+ +
+

+ + Event Type +

+
+ +
+

+ + Event Services +

+

+

After installing a new service, you will get an option to select the service in the event order.

+

+

+

Creating an Event Order

+

+
+ +
+
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ diff --git a/event_management/static/img/event_type_image1.jpg b/event_management/static/img/event_type_image1.jpg new file mode 100644 index 000000000..208cf6045 Binary files /dev/null and b/event_management/static/img/event_type_image1.jpg differ diff --git a/event_management/static/img/event_type_image2.jpeg b/event_management/static/img/event_type_image2.jpeg new file mode 100644 index 000000000..c74b7c25f Binary files /dev/null and b/event_management/static/img/event_type_image2.jpeg differ diff --git a/event_management/static/img/event_type_image3.jpeg b/event_management/static/img/event_type_image3.jpeg new file mode 100644 index 000000000..c63d5de66 Binary files /dev/null and b/event_management/static/img/event_type_image3.jpeg differ diff --git a/event_management/static/img/event_type_image4.jpeg b/event_management/static/img/event_type_image4.jpeg new file mode 100644 index 000000000..e60d88943 Binary files /dev/null and b/event_management/static/img/event_type_image4.jpeg differ diff --git a/event_management/static/img/event_type_image5.jpeg b/event_management/static/img/event_type_image5.jpeg new file mode 100644 index 000000000..777a7eeba Binary files /dev/null and b/event_management/static/img/event_type_image5.jpeg differ diff --git a/event_management/static/img/event_type_image6.jpeg b/event_management/static/img/event_type_image6.jpeg new file mode 100644 index 000000000..686b70056 Binary files /dev/null and b/event_management/static/img/event_type_image6.jpeg differ diff --git a/event_management/static/src/css/event_dashboard.css b/event_management/static/src/css/event_dashboard.css new file mode 100644 index 000000000..f7461404d --- /dev/null +++ b/event_management/static/src/css/event_dashboard.css @@ -0,0 +1,12 @@ +.style_event { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} +.style_event_type { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} diff --git a/event_management/views/dashboard.xml b/event_management/views/dashboard.xml new file mode 100644 index 000000000..8e6a6a24d --- /dev/null +++ b/event_management/views/dashboard.xml @@ -0,0 +1,63 @@ + + + + + event_management_kanban.dashboard + event.management.type + kanban + + + + + + + +
+
+
+

+
+
+ +
+
+ +
+
+ + Total Orders : + + + + +
+
+
+
+
+
+
+
+ + + + + + Dashboard + event.management.type + form + kanban,form + {} + + + +
+
\ No newline at end of file diff --git a/event_management/views/event_management_view.xml b/event_management/views/event_management_view.xml new file mode 100644 index 000000000..7f8d8899b --- /dev/null +++ b/event_management/views/event_management_view.xml @@ -0,0 +1,206 @@ + + + + + + + + event_management_tree_view.tree + event.management + + + + + + + + + + + + + + + + + event_management_kanban_view.kanban + event.management + + + + + +
+ + +
+ + + +
+
+
+ +
+
+
+
+ + + + + + + + + + event_management_form_view.form + event.management + +
+
+
+ +
+ +
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + event_management_view.search + event.management + + + + + + + + + + + + + + + + + + event_management_view.calendar + event.management + + + + + + + + + + + + + event_management_view.graph + event.management + + + + + + + + + + + + Event Management + event.management + ir.actions.act_window + form + kanban,tree,form,calendar,graph + +

+ Click to add an event order. +

+ Here you can create and manage your events. +

+
+
+ + + + + + + + + \ No newline at end of file diff --git a/event_management/views/event_type_view.xml b/event_management/views/event_type_view.xml new file mode 100644 index 000000000..0931b9edf --- /dev/null +++ b/event_management/views/event_type_view.xml @@ -0,0 +1,52 @@ + + + + + + event_type_tree_view.tree + event.management.type + + + + + + + + + event_type_form_view.form + event.management.type + +
+ +
+ +
+

+ +

+
+
+
+
+ + + Event type + event.management.type + ir.actions.act_window + form + tree,form + +

+ Click to add an event type. +

+ Here you can create different types of events. +

+
+
+ + + + +
+
\ No newline at end of file