diff --git a/event_catering/README.rst b/event_catering/README.rst new file mode 100644 index 000000000..03cc4e5ce --- /dev/null +++ b/event_catering/README.rst @@ -0,0 +1,24 @@ +================== +Event Catering v10 +================== +Event Catering attaches catering service to Event Management module thus extending the scope of the Event Management Module. +When you install this module, a new service 'Catering' will be available in event management. + +Features +======== +* Automatically creates from event order. +* Catering manager can update the state of the event order. +* Single click for completing a work. + +Contributors +============ + +* Avinash Nk + + +Maintainer +========== + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com diff --git a/event_catering/__init__.py b/event_catering/__init__.py new file mode 100644 index 000000000..18b219312 --- /dev/null +++ b/event_catering/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . import models diff --git a/event_catering/__manifest__.py b/event_catering/__manifest__.py new file mode 100644 index 000000000..e2c36effd --- /dev/null +++ b/event_catering/__manifest__.py @@ -0,0 +1,45 @@ +# -*- 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 Catering Service', + 'version': '10.0.1.0.0', + 'summary': """Catering Service for Event Management Module.""", + 'description': """Catering Service for Event Management Module.""", + "category": "Specific Industry Applications", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['event_management'], + 'data': ['security/catering_security.xml', + 'security/ir.model.access.csv', + 'views/catering_service.xml', + 'views/event_form.xml', + 'data/catering_service.xml', + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, +} diff --git a/event_catering/data/catering_service.xml b/event_catering/data/catering_service.xml new file mode 100644 index 000000000..d02352581 --- /dev/null +++ b/event_catering/data/catering_service.xml @@ -0,0 +1,22 @@ + + + + + + Catering Service + catering.order.sequence + %(day)s/%(month)s/%(year)s + CAT- + 1 + 2 + + + + Catering Service + service + + + + + + diff --git a/event_catering/models/__init__.py b/event_catering/models/__init__.py new file mode 100644 index 000000000..eeb1c026c --- /dev/null +++ b/event_catering/models/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . import catering_service diff --git a/event_catering/models/catering_service.py b/event_catering/models/catering_service.py new file mode 100644 index 000000000..70fb97ece --- /dev/null +++ b/event_catering/models/catering_service.py @@ -0,0 +1,160 @@ +# -*- 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 + + +class EventManagementInherit(models.Model): + _inherit = 'event.management' + + catering_on = fields.Boolean(string="Catering Active", default=False) + catering_id = fields.Many2one('event.management.catering', string="Catering Id") + catering_pending = fields.Integer(string='Catering Pending', compute='compute_catering_pending') + catering_done = fields.Integer(string='Catering Done', compute='compute_catering_done') + + @api.multi + def compute_catering_pending(self): + for order in self.catering_id: + pending = 0 + for lines in order.catering_works: + if lines.work_done is False: + pending += 1 + self.catering_pending = pending + + @api.multi + def compute_catering_done(self): + for order in self.catering_id: + done = 0 + for lines in order.catering_works: + if lines.work_done is True: + done += 1 + self.catering_done = done + + @api.multi + def event_confirm(self): + catering_service = self.env['event.management.catering'] + catering_line = self.service_line.search([('service', '=', 'catering'), ('event_id', '=', self.id)]) + if len(catering_line) > 0: + self.catering_on = True + sequence_code = 'catering.order.sequence' + name = self.env['ir.sequence'].next_by_code(sequence_code) + event = self.id + event_type = self.type_of_event.id + start_date = catering_line.date_from + end_date = catering_line.date_to + catering_id = catering_line.id + data = { + 'name': name, + 'start_date': start_date, + 'end_date': end_date, + 'parent_event': event, + 'event_type': event_type, + 'catering_id': catering_id, + } + catering_map = catering_service.create(data) + self.catering_id = catering_map.id + super(EventManagementInherit, self).event_confirm() + + @api.multi + def action_view_catering_service(self): + """This function returns an action that display existing catering service + of the event.""" + action = self.env.ref('event_catering.event_catering_action').read()[0] + action['views'] = [(self.env.ref('event_catering.event_catering_form_view').id, 'form')] + action['res_id'] = self.catering_id.id + if self.catering_id.id is not False: + return action + + +class EventService(models.Model): + _inherit = 'event.service.line' + + service = fields.Selection(selection_add=[('catering', 'Catering')]) + + +class EventManagementCatering(models.Model): + _name = 'event.management.catering' + + name = fields.Char(string="Name", readonly=True) + date = fields.Date(string="Date", default=fields.Date.today, readonly=True) + start_date = fields.Datetime(string="Start date", readonly=True) + end_date = fields.Datetime(string="End date", readonly=True) + catering_works = fields.One2many('event.catering.works', 'catering_id', string="Catering Works") + state = fields.Selection([('open', 'Open'), ('done', 'Done')], string="State", default="open") + note = fields.Text(string="Terms and conditions") + price_subtotal = fields.Float(string='Total', compute='sub_total_update', readonly=True, store=True) + parent_event = fields.Many2one('event.management', string="Event", readonly=True) + catering_id = fields.Integer(string="Catering Id") + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + event_type = fields.Many2one('event.management.type', string="Event Type", readonly=True) + + @api.multi + @api.depends('catering_works') + def sub_total_update(self): + total = 0 + for items in self.catering_works: + total += items.quantity * items.amount + self.price_subtotal = total + + @api.multi + def catering_done(self): + for items in self.catering_works: + if items.work_done is False: + raise UserError(_("Catering works are pending")) + related_product = self.env.ref('event_catering.catering_service_product').id + for items in self.sudo().parent_event.service_line: + if items.id == self.sudo().catering_id: + items.sudo().write({'amount': self.price_subtotal, 'state': 'done', 'related_product': related_product}) + self.state = "done" + + +class EventCateringWorks(models.Model): + _name = 'event.catering.works' + + service = fields.Many2one('product.product', string="Services", required=True) + quantity = fields.Float(string="Quantity", default=1) + amount = fields.Float(string="Amount") + sub_total = fields.Float(string="Sub Total", compute="sub_total_computation", readonly=True) + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + catering_id = fields.Many2one('event.management.catering', string="Catering Id") + work_done = fields.Boolean(string="Work done", default=False) + + @api.onchange('service') + def onchange_service(self): + self.amount = self.service.lst_price + + @api.one + @api.depends('quantity', 'amount') + def sub_total_computation(self): + self.sub_total = self.quantity * self.amount + + @api.multi + def work_completed(self): + if self.catering_id.state == "open": + self.work_done = False + + @api.multi + def not_completed(self): + if self.catering_id.state == "open": + self.work_done = True diff --git a/event_catering/security/catering_security.xml b/event_catering/security/catering_security.xml new file mode 100644 index 000000000..475ce9344 --- /dev/null +++ b/event_catering/security/catering_security.xml @@ -0,0 +1,15 @@ + + + + + + Catering Manager + + + + + + + + + \ No newline at end of file diff --git a/event_catering/security/ir.model.access.csv b/event_catering/security/ir.model.access.csv new file mode 100644 index 000000000..4b10bc33b --- /dev/null +++ b/event_catering/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +event_management_catering_id,event_management_catering,model_event_management_catering,event_management.group_event_manager,1,1,1,1 +event_catering_works_id,event_catering_works,model_event_catering_works,event_management.group_event_manager,1,1,1,1 + +event_management_catering_id1,event_management_catering1,model_event_management_catering,event_catering.group_catering_manager,1,1,1,1 +event_catering_works_id1,event_catering_works1,model_event_catering_works,event_catering.group_catering_manager,1,1,1,1 +event_management_type_id1,event_management_type1,event_management.model_event_management_type,event_catering.group_catering_manager,1,0,0,0 + diff --git a/event_catering/static/description/banner.jpg b/event_catering/static/description/banner.jpg new file mode 100644 index 000000000..29a47b8f8 Binary files /dev/null and b/event_catering/static/description/banner.jpg differ diff --git a/event_catering/static/description/cybro_logo.png b/event_catering/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/event_catering/static/description/cybro_logo.png differ diff --git a/event_catering/static/description/event_catering.png b/event_catering/static/description/event_catering.png new file mode 100644 index 000000000..d5e84cff2 Binary files /dev/null and b/event_catering/static/description/event_catering.png differ diff --git a/event_catering/static/description/event_catering_form.png b/event_catering/static/description/event_catering_form.png new file mode 100644 index 000000000..9e1c6ef01 Binary files /dev/null and b/event_catering/static/description/event_catering_form.png differ diff --git a/event_catering/static/description/icon.png b/event_catering/static/description/icon.png new file mode 100644 index 000000000..b4c4fdba5 Binary files /dev/null and b/event_catering/static/description/icon.png differ diff --git a/event_catering/static/description/index.html b/event_catering/static/description/index.html new file mode 100644 index 000000000..7d85c92c0 --- /dev/null +++ b/event_catering/static/description/index.html @@ -0,0 +1,75 @@ +
+
+
+

Event Catering

+

Catering service for Event management module.

+

Manage all works related to catering.

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •    Automatically creates from event order.
  • +
  •    Catering manager can update the state of the event order.
  • +
  •    Single click for completing a work.
  • +
+
+
+
+ +
+
+
+

Overview

+

Event Catering attaches catering service to Event Management module thus extending the scope of the Event Management Module. When you install this module, a new service 'Catering' will be available in event management.

+
+
+
+ +
+
+
+

Event Catering

+
+ +
+
+
+
+ +
+
+
+

Event Catering Form View

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/event_catering/static/img/catering_product-image.jpeg b/event_catering/static/img/catering_product-image.jpeg new file mode 100644 index 000000000..4a4687765 Binary files /dev/null and b/event_catering/static/img/catering_product-image.jpeg differ diff --git a/event_catering/views/catering_service.xml b/event_catering/views/catering_service.xml new file mode 100644 index 000000000..c3a880536 --- /dev/null +++ b/event_catering/views/catering_service.xml @@ -0,0 +1,169 @@ + + + + + + + + event_catering_tree_view.tree + event.management.catering + + + + + + + + + + + + + + + event_catering_kanban_view.kanban + event.management.catering + + + + + +
+
+
+
+ + + +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + + + + event_catering_form_view.form + event.management.catering + +
+
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff --git a/event_management/README.rst b/event_management/README.rst new file mode 100644 index 000000000..98f45c677 --- /dev/null +++ b/event_management/README.rst @@ -0,0 +1,32 @@ +==================== +Event Management v10 +==================== +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..18b219312 --- /dev/null +++ b/event_management/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . import models diff --git a/event_management/__manifest__.py b/event_management/__manifest__.py new file mode 100644 index 000000000..2746dafc7 --- /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': '10.0.1.0.0', + 'summary': """Core Module for Managing Different Types Of Events.""", + 'description': """Core Module for Managing Different Types Of Events""", + "category": "Specific Industry Applications", + '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..cd3e0d0ff --- /dev/null +++ b/event_management/models/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . 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..19d271f47 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..9113daf58 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..1a844c37a 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..0f77e8e43 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..fdb98122d --- /dev/null +++ b/event_management/static/description/index.html @@ -0,0 +1,117 @@ +
+
+
+

Event Management

+

Manage different types of events.

+

Core Module for Event Management.

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •    Event order creation.
  • +
  •    Automatically creates service orders.
  • +
  •    Allocate the services to different users.
  • +
  •    Integrated with Accounting module.
  • +
  •    Simple Workflow.
  • +
  •    Attractive Design.
  • +
+
+
+
+ +
+
+
+

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.

+
+
+
+ +
+
+
+

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

+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
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..aa8c545fb 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..2593bdcdb 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..d14656550 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..9a9e4f79e 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..13281a6a2 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..360c61c55 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..8f183b9c7 --- /dev/null +++ b/event_management/views/dashboard.xml @@ -0,0 +1,62 @@ + + + + + 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..a56fdf8a6 --- /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