Browse Source

[ADD] Initial Commit

pull/57/head
Sreejith 7 years ago
parent
commit
9aea5858a8
  1. 24
      event_catering/README.rst
  2. 22
      event_catering/__init__.py
  3. 45
      event_catering/__manifest__.py
  4. 22
      event_catering/data/catering_service.xml
  5. 22
      event_catering/models/__init__.py
  6. 160
      event_catering/models/catering_service.py
  7. 15
      event_catering/security/catering_security.xml
  8. 8
      event_catering/security/ir.model.access.csv
  9. BIN
      event_catering/static/description/banner.jpg
  10. BIN
      event_catering/static/description/cybro_logo.png
  11. BIN
      event_catering/static/description/event_catering.png
  12. BIN
      event_catering/static/description/event_catering_form.png
  13. BIN
      event_catering/static/description/icon.png
  14. 75
      event_catering/static/description/index.html
  15. BIN
      event_catering/static/img/catering_product-image.jpeg
  16. 169
      event_catering/views/catering_service.xml
  17. 32
      event_catering/views/event_form.xml
  18. 32
      event_management/README.rst
  19. 22
      event_management/__init__.py
  20. 46
      event_management/__manifest__.py
  21. 40
      event_management/data/event_management.xml
  22. 22
      event_management/models/__init__.py
  23. 222
      event_management/models/event_management.py
  24. 17
      event_management/security/event_security.xml
  25. 5
      event_management/security/ir.model.access.csv
  26. BIN
      event_management/static/description/banner.jpg
  27. BIN
      event_management/static/description/cybro_logo.png
  28. BIN
      event_management/static/description/event_dashboard.png
  29. BIN
      event_management/static/description/event_order.png
  30. BIN
      event_management/static/description/event_order_creation.gif
  31. BIN
      event_management/static/description/event_order_form.png
  32. BIN
      event_management/static/description/event_type.png
  33. BIN
      event_management/static/description/icon.png
  34. 117
      event_management/static/description/index.html
  35. BIN
      event_management/static/img/event_type_image1.jpg
  36. BIN
      event_management/static/img/event_type_image2.jpeg
  37. BIN
      event_management/static/img/event_type_image3.jpeg
  38. BIN
      event_management/static/img/event_type_image4.jpeg
  39. BIN
      event_management/static/img/event_type_image5.jpeg
  40. BIN
      event_management/static/img/event_type_image6.jpeg
  41. 12
      event_management/static/src/css/event_dashboard.css
  42. 62
      event_management/views/dashboard.xml
  43. 206
      event_management/views/event_management_view.xml
  44. 52
      event_management/views/event_type_view.xml

24
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 <avinash@cybrosys.in>
Maintainer
==========
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com

22
event_catering/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

45
event_catering/__manifest__.py

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'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,
}

22
event_catering/data/catering_service.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="sequence_catering_order" model="ir.sequence">
<field name="name">Catering Service</field>
<field name="code">catering.order.sequence</field>
<field name="suffix"> %(day)s/%(month)s/%(year)s</field>
<field name="prefix">CAT-</field>
<field name="number_increment">1</field>
<field name="padding">2</field>
</record>
<record model="product.product" id="catering_service_product">
<field name="name">Catering Service</field>
<field name="type">service</field>
<field name="image" type="base64" file="event_catering/static/img/catering_product-image.jpeg"/>
</record>
</data>
</odoo>

22
event_catering/models/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import catering_service

160
event_catering/models/catering_service.py

@ -0,0 +1,160 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
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

15
event_catering/security/catering_security.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="group_catering_manager" model="res.groups">
<field name="name">Catering Manager</field>
<field name="category_id" ref="event_management.category_event_management"/>
</record>
<record id="event_management.group_event_manager" model="res.groups">
<field name="implied_ids" eval="[(4, ref('group_catering_manager'))]"/>
</record>
</data>
</odoo>

8
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 event_management_catering_id event_management_catering model_event_management_catering event_management.group_event_manager 1 1 1 1
3 event_catering_works_id event_catering_works model_event_catering_works event_management.group_event_manager 1 1 1 1
4 event_management_catering_id1 event_management_catering1 model_event_management_catering event_catering.group_catering_manager 1 1 1 1
5 event_catering_works_id1 event_catering_works1 model_event_catering_works event_catering.group_catering_manager 1 1 1 1
6 event_management_type_id1 event_management_type1 event_management.model_event_management_type event_catering.group_catering_manager 1 0 0 0

BIN
event_catering/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
event_catering/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
event_catering/static/description/event_catering.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
event_catering/static/description/event_catering_form.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
event_catering/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

75
event_catering/static/description/index.html

@ -0,0 +1,75 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Event Catering</h2>
<h3 class="oe_slogan">Catering service for Event management module.</h3>
<h3 class="oe_slogan">Manage all works related to catering.</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced">
<h4><p style="margin-left: 42px;">Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Automatically creates from event order.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Catering manager can update the state of the event order.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Single click for completing a work.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">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.</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Catering</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_catering.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Catering Form View</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_catering_form.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
event_catering/static/img/catering_product-image.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

169
event_catering/views/catering_service.xml

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<!-- Tree Views -->
<record id="event_catering_tree_view" model="ir.ui.view">
<field name="name">event_catering_tree_view.tree</field>
<field name="model">event.management.catering</field>
<field name="arch" type="xml">
<tree create="false">
<field name="name"/>
<field name="event_type"/>
<field name="date"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>
</field>
</record>
<!-- Kanban Views -->
<record id="event_catering_kanban_view" model="ir.ui.view">
<field name="name">event_catering_kanban_view.kanban</field>
<field name="model">event.management.catering</field>
<field name="arch" type="xml">
<kanban quick_create="false" create="false">
<field name="event_type"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click col-md-4" style="padding-top: 1%;padding-bottom: 1%;border: 1px solid #888888;">
<div class="col-md-12" style="padding: 0px;">
<div class="col-md-5" style="padding-left: 0px;">
<div>
<t>
<img t-att-src="kanban_image('event.management.type', 'image', record.event_type.raw_value)" style="width:100%"/>
</t>
</div>
</div>
<div class="col-md-7" style="padding-top: 6%;">
<div class="oe_kanban_content">
<div>
<strong><field name="name"/></strong>
</div>
</div>
<div class="oe_kanban_content">
<div>
<strong><field name="event_type"/></strong>
</div>
</div>
</div>
</div>
<div class="oe_clear"></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Form Views -->
<record id="event_catering_form_view" model="ir.ui.view">
<field name="name">event_catering_form_view.form</field>
<field name="model">event.management.catering</field>
<field name="arch" type="xml">
<form create="false">
<header>
<button name="catering_done" string="Done" type="object" class="oe_highlight" states="open"/>
<field name="state" widget="statusbar" statusbar_visible="open,done"/>
</header>
<sheet>
<h1>
<field name="name"/>
</h1>
<group>
<group>
<field name="parent_event"/>
<field name="event_type"/>
</group>
<group>
<field name="date"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
<notebook>
<page string="Catering Works">
<field name="catering_works" mode="tree" attrs="{'readonly': [('state', '=', 'done')]}">
<form string="Catering Lines Form">
<group>
<group>
<field name="service"/>
<field name="amount"/>
</group>
</group>
</form>
<tree string="Catering Lines Tree" editable="bottom">
<field name="service"/>
<field name="quantity"/>
<field name="amount"/>
<field name="work_done" invisible="1"/>
<field name="currency_id" invisible="1"/>
<button name="work_completed" icon="fa fa-check-square" type="object"
attrs="{'invisible': [('work_done', '=', False)]}"
help="If work is not complete, click here"/>
<button name="not_completed" icon="fa fa-close" type="object"
attrs="{'invisible': [('work_done', '=', True)]}"
help="If work complete, click here"/>
<field name="sub_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right" colspan="2" name="catering_total">
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="price_subtotal"/>
</div>
<field name="price_subtotal" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group>
<field name="note" class="oe_inline"
placeholder="Setup default terms and conditions in your company settings."
attrs="{'readonly': [('state', '=', 'done')]}"/>
<div class="oe_clear"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Search Views -->
<record id="event_catering_search_view" model="ir.ui.view">
<field name="name">event_catering_view.search</field>
<field name="model">event.management.catering</field>
<field name="arch" type="xml">
<search string="Catering">
<field name="name"/>
<field name="event_type"/>
<field name="catering_works"/>
<filter string="Open" domain="[('state','=','open')]"/>
<group expand="0" string="Group By">
<filter string="Event Type" domain="[]" context="{'group_by':'event_type'}"/>
</group>
</search>
</field>
</record>
<record id="event_catering_action" model="ir.actions.act_window">
<field name="name">Catering Service</field>
<field name="res_model">event.management.catering</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
You can't create a direct catering.
</p><p>
Catering service is created from event order.
</p>
</field>
</record>
<menuitem id="event_management_catering_menu" name="Catering"
parent="event_management.event_management_service" action="event_catering_action" groups="event_catering.group_catering_manager"/>
</data>
</odoo>

32
event_catering/views/event_form.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="event_management_form_view_catering" model="ir.ui.view">
<field name="name">event_management_form_view_catering.form</field>
<field name="model">event.management</field>
<field name="inherit_id" ref="event_management.event_management_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button name="action_view_catering_service"
type="object"
class="oe_stat_button"
attrs="{'invisible': [('catering_on', '=', False)]}"
help="Catering">
<div class="fa fa-cutlery" style="font-size:21px;padding-left:8px;padding-right:5px;color:#7C7BAD;"></div>
<div class="o_stat_info" style="position: static;padding-left:10px;font-size:12px;font-weight:300;color:#d60000;">
<div style="font-weight:600;font-size:13px"><field name="catering_pending"/></div>
<span class="o_stat_info">Pending</span>
</div>
<div class="o_stat_info" style="padding-left:10px;font-size:12px;font-weight:300;color:#569220;">
<div style="font-weight:600;font-size:13px"><field name="catering_done"/></div>
<span class="o_stat_info">Done</span>
</div>
</button>
</div>
<field name="partner_id" position="after">
<field name="catering_on" invisible="1"/>
</field>
</field>
</record>
</odoo>

32
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 <avinash@cybrosys.in>
Maintainer
==========
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com

22
event_management/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

46
event_management/__manifest__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'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,
}

40
event_management/data/event_management.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="event_type1" model="event.management.type">
<field name="name">Wedding</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image1.jpg"/>
</record>
<record id="event_type2" model="event.management.type">
<field name="name">Birthday</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image2.jpeg"/>
</record>
<record id="event_type3" model="event.management.type">
<field name="name">Family Events</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image3.jpeg"/>
</record>
<record id="event_type4" model="event.management.type">
<field name="name">Press Conference</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image4.jpeg"/>
</record>
<record id="event_type5" model="event.management.type">
<field name="name">Seminars</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image5.jpeg"/>
</record>
<record id="event_type6" model="event.management.type">
<field name="name">Conferences</field>
<field name="image" type="base64" file="event_management/static/img/event_type_image6.jpeg"/>
</record>
<record id="sequence_event_order" model="ir.sequence">
<field name="name">Event Order</field>
<field name="code">event.order.sequence</field>
<field name="suffix"> %(day)s/%(month)s/%(year)s</field>
<field name="prefix">EVE-</field>
<field name="number_increment">1</field>
<field name="padding">2</field>
</record>
</data>
</odoo>

22
event_management/models/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import event_management

222
event_management/models/event_management.py

@ -0,0 +1,222 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Avinash Nk(<avinash@cybrosys.in>)
#
# 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 <https://www.gnu.org/licenses/>.
#
###################################################################################
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)

17
event_management/security/event_security.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="category_event_management" model="ir.module.category">
<field name="name">Event Management</field>
<field name="sequence">19</field>
</record>
<record id="group_event_manager" model="res.groups">
<field name="name">Event Manager</field>
<field name="category_id" ref="category_event_management"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
</data>
</odoo>

5
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 event_management_id event_management model_event_management event_management.group_event_manager 1 1 1 1
3 event_service_line_id event_service_line model_event_service_line event_management.group_event_manager 1 1 1 1
4 event_management_type_id event_management_type model_event_management_type event_management.group_event_manager 1 1 1 1

BIN
event_management/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
event_management/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
event_management/static/description/event_dashboard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 KiB

BIN
event_management/static/description/event_order.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

BIN
event_management/static/description/event_order_creation.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
event_management/static/description/event_order_form.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
event_management/static/description/event_type.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

BIN
event_management/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

117
event_management/static/description/index.html

@ -0,0 +1,117 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Event Management</h2>
<h3 class="oe_slogan">Manage different types of events.</h3>
<h3 class="oe_slogan">Core Module for Event Management.</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced">
<h4><p style="margin-left: 42px;">Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Event order creation.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Automatically creates service orders.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Allocate the services to different users.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Integrated with Accounting module.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Simple Workflow.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9733;</span>&nbsp;&nbsp; Attractive Design.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">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.</p>
<p class="oe_mt32">Note: Presently we have released the service 'Event Catering' under this module. New services are being developed by our team.</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Dashboard</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_dashboard.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Order View</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_order.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Order Form View</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_order_form.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Type</h1> </p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_type.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p><h1>Event Services</h1> </p>
<p class="oe_mt32">
<p>After installing a new service, you will get an option to select the service in the event order.</p>
</p>
<p class="oe_mt32">
<p>Creating an Event Order</p>
</p>
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_order_creation.gif">
</div>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
event_management/static/img/event_type_image1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

BIN
event_management/static/img/event_type_image2.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
event_management/static/img/event_type_image3.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 MiB

BIN
event_management/static/img/event_type_image4.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

BIN
event_management/static/img/event_type_image5.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
event_management/static/img/event_type_image6.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

12
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;
}

62
event_management/views/dashboard.xml

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="event_management_kanban" model="ir.ui.view" >
<field name="name">event_management_kanban.dashboard</field>
<field name="model">event.management.type</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard" create="0">
<field name="name"/>
<field name="event_count"/>
<templates>
<t t-name="kanban-box">
<div class="col-md-12" style="margin-bottom: 2%;">
<div class="o_primary style_event_type col-md-12" style="padding-bottom: 4%;">
<div class="col-md-10">
<h1 style="text-align:left;"><field name="name"/></h1>
</div>
<div class="col-md-2">
<button type="edit" string="Settings" class="button_background" style="margin-top: 22px;background: none !important;border: none !IMPORTANT;FONT-SIZE: 16px;">
<i class="fa fa-cog fa-spin"/>
</button>
</div>
<div class="col-md-12">
<img t-att-src="kanban_image('event.management.type', 'image', record.id.value)" class="img-responsive" style="width:100%; border-radius: 13px;"/>
</div>
<div class="col-md-12">
<span style="margin-top: 6%;margin-bottom: 2%;font-weight: 600;">
<span class=" o_primary" style="float: left;">Total Orders :</span>
<span class=" o_primary" style="">
<field name="event_count"/>
</span>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<template id="assets_backend" name="sales_team assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet"
href="/event_management/static/src/css/event_dashboard.css"/>
</xpath>
</template>
<record id="event_dashboard_action" model="ir.actions.act_window">
<field name="name">Dashboard</field>
<field name="res_model">event.management.type</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,form</field>
<field name="context">{}</field>
</record>
<menuitem id="event_management_dashboard" parent="event_management.event_management_main_menu"
action="event_dashboard_action" sequence="1"/>
</data>
</odoo>

206
event_management/views/event_management_view.xml

@ -0,0 +1,206 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<!-- Tree Views -->
<record id="event_management_tree_view" model="ir.ui.view">
<field name="name">event_management_tree_view.tree</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="type_of_event"/>
<field name="partner_id"/>
<field name="date"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Kanban Views -->
<record id="event_management_kanban_view" model="ir.ui.view">
<field name="name">event_management_kanban_view.kanban</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<kanban quick_create="false" >
<field name="type_of_event"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click col-md-2 style_event">
<div class="o_kanban_image" style="width:100%; ">
<t>
<img t-att-src="kanban_image('event.management.type', 'image', record.type_of_event.raw_value)" style="width:100%; border-radius: 28px;"/>
</t>
</div>
<div class="oe_kanban_content" style="padding-left: 0px !important;">
<div style="text-align: center;padding-top: 4px;">
<strong><field name="name"/></strong>
</div>
</div>
<div class="oe_clear"/>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Form Views -->
<record id="event_management_form_view" model="ir.ui.view">
<field name="name">event_management_form_view.form</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<form>
<header>
<button name="event_confirm" string="Confirm" type="object" class="oe_highlight" states="draft"/>
<button name="event_invoice_create" string="Create Invoice" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('state', 'not in', ['invoice', 'confirm']), ('pending_invoice', '=', False)]}"/>
<button name="event_cancel" string="Cancel" type="object" states="draft"/>
<button name="event_close" string="Close" type="object" states="invoice"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,invoice,close"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_invoice_event"
type="object"
class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('state', 'not in', ['invoice', 'close'])]}">
<field name="invoice_count" widget="statinfo" string="Invoices"/>
</button>
</div>
<h1>
<field name="name"/>
</h1>
<group>
<group>
<field name="type_of_event" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
<field name="partner_id" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
</group>
<group>
<field name="date" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
<field name="start_date" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
<field name="end_date" attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
<field name="currency_id" invisible="1"/>
<field name="pending_invoice" invisible="1"/>
</group>
</group>
<notebook>
<page string="Service Lines">
<field name="service_line" mode="tree" attrs="{'readonly': [('state', 'not in', ['draft'])]}">
<form string="Service Lines Form">
<group>
<group>
<field name="service"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="amount"/>
</group>
</group>
</form>
<tree string="Service Lines Tree" editable="bottom" colors="#10993b:state=='done';#f20b07:state=='pending'">
<field name="service"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="state" readonly="1"/>
<field name="invoiced" readonly="1"/>
<field name="currency_id" invisible="1"/>
<field name="related_product" invisible="1"/>
<field name="invoiced" invisible="1"/>
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right" colspan="2" name="event_total">
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="price_subtotal"/>
</div>
<field name="price_subtotal" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</group>
<field name="note" class="oe_inline" placeholder="Setup default terms and conditions in your company settings." attrs="{'readonly': [('state', 'not in', ['draft'])]}"/>
<div class="oe_clear"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Search Views -->
<record id="event_management_search_view" model="ir.ui.view">
<field name="name">event_management_view.search</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<search string="Event Management">
<field name="name"/>
<field name="type_of_event"/>
<field name="partner_id"/>
<field name="service_line"/>
<group expand="0" string="Group By">
<filter string="Event Type" domain="[]" context="{'group_by':'type_of_event'}"/>
<filter string="State" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<!-- Calendar View -->
<record id="event_management_calender_view" model="ir.ui.view">
<field name="name">event_management_view.calendar</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<calendar string="Event Orders" date_start="start_date" date_stop="end_date" color="type_of_event">
<field name="name"/>
<field name="partner_id"/>
<field name="state"/>
</calendar>
</field>
</record>
<!-- Graph View -->
<record id="event_management_graph_view" model="ir.ui.view">
<field name="name">event_management_view.graph</field>
<field name="model">event.management</field>
<field name="arch" type="xml">
<graph string="Event Orders">
<field name="partner_id"/>
<field name="type_of_event"/>
<field name="price_subtotal" type="measure"/>
</graph>
</field>
</record>
<record id="event_management_action" model="ir.actions.act_window">
<field name="name">Event Management</field>
<field name="res_model">event.management</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form,calendar,graph</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add an event order.
</p><p>
Here you can create and manage your events.
</p>
</field>
</record>
<menuitem id="event_management_main_menu" name="Event Management"/>
<menuitem id="event_management_sub_menu1" name="Event Management" parent="event_management_main_menu"
sequence="5"/>
<menuitem id="event_management_sub_menu2" name="Event Management" parent="event_management_sub_menu1"
action="event_management_action" sequence="2"/>
<menuitem id="event_management_service" name="Service" parent="event_management_sub_menu1" sequence="4"/>
</data>
</odoo>

52
event_management/views/event_type_view.xml

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="event_type_tree_view" model="ir.ui.view">
<field name="name">event_type_tree_view.tree</field>
<field name="model">event.management.type</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
</tree>
</field>
</record>
<record id="event_type_form_view" model="ir.ui.view">
<field name="name">event_type_form_view.form</field>
<field name="model">event.management.type</field>
<field name="arch" type="xml">
<form>
<sheet>
<div style="text-align: center;">
<field name="image" widget='image' style="width:540px;height: 360px;"/>
</div>
<h1 style="text-align: center;">
<field name="name" required="1"/>
</h1>
</sheet>
</form>
</field>
</record>
<record id="event_management_type_action" model="ir.actions.act_window">
<field name="name">Event type</field>
<field name="res_model">event.management.type</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add an event type.
</p><p>
Here you can create different types of events.
</p>
</field>
</record>
<menuitem id="event_management_configuration_menu" name="Configuration" parent="event_management_main_menu" groups="event_management.group_event_manager"/>
<menuitem id="event_management_type_menu" name="Event Type" parent="event_management_configuration_menu"
action="event_management_type_action"/>
</data>
</odoo>
Loading…
Cancel
Save