diff --git a/studio_management/__init__.py b/studio_management/__init__.py new file mode 100644 index 000000000..4315ab973 --- /dev/null +++ b/studio_management/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models +import wizard +import report + diff --git a/studio_management/__manifest__.py b/studio_management/__manifest__.py new file mode 100644 index 000000000..c8a2123a2 --- /dev/null +++ b/studio_management/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': 'Digital Studio Management', + 'version': '10.0.1.0.0', + 'summary': """Easily Manage Multimedia/Studio Industry""", + 'description': """Easily Manage Multimedia/Studio Industry""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Industries', + 'depends': ['base', 'report'], + 'license': 'LGPL-3', + 'data': [ + 'security/studio_security.xml', + 'wizard/studio_report_wizard.xml', + 'views/session_view.xml', + 'views/studio_report.xml', + 'views/session_type.xml', + 'views/editing_works.xml', + 'views/studio_sequence.xml', + 'views/studio_views.xml', + 'report/report_template.xml', + 'security/ir.model.access.csv' + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/studio_management/models/__init__.py b/studio_management/models/__init__.py new file mode 100644 index 000000000..591350080 --- /dev/null +++ b/studio_management/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import session_model, editing_works \ No newline at end of file diff --git a/studio_management/models/editing_works.py b/studio_management/models/editing_works.py new file mode 100644 index 000000000..c8e81e6fc --- /dev/null +++ b/studio_management/models/editing_works.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api, _ + + +class EditingWorks(models.Model): + _name = 'editing.works' + + name = fields.Char(string='Name', required=True, copy=False, readonly=True, default=lambda self: _('New')) + session_id = fields.Many2one('session.details', string='Session Id') + work_done = fields.Char(string='Work', required=True) + time_taken = fields.Float(string='Time Taken', required=True) + work_by = fields.Many2one('res.users', string='Work By', required=True, default=lambda self: self.env.user) + state = fields.Selection([('draft', 'Draft'), ('ongoing', 'Ongoing'), ('completed', 'Completed')], + string='State', default='draft', required=True) + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code('editing.works') or 'New' + return super(EditingWorks, self).create(vals) diff --git a/studio_management/models/session_model.py b/studio_management/models/session_model.py new file mode 100644 index 000000000..9c66ba855 --- /dev/null +++ b/studio_management/models/session_model.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class SessionDetails(models.Model): + _name = 'session.details' + + name = fields.Char(string='Name', required=True, copy=False, readonly=True, default=lambda self: _('New')) + customer_id = fields.Many2one('res.partner', string='Customer', required=True) + order_date = fields.Datetime(string='Order Date') + return_date = fields.Datetime(string='Return Date') + type_id = fields.Many2one('session.type', string='Type') + editing_work_id = fields.One2many('editing.works', 'session_id', string='Editing Work') + note_field = fields.Html(string='Comment') + state = fields.Selection([('draft', 'Draft'), ('design', 'Designing'), ('closed', 'Closed')], + string='State', default='draft', required=True) + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code('session.details') or 'New' + return super(SessionDetails, self).create(vals) + + @api.multi + def submit_session(self): + self.state = 'design' + + @api.multi + def close_session(self): + for rec in self.editing_work_id: + if rec.state != 'completed': + raise UserError(_('All Works Must Be Completed')) + if self.return_date: + self.state = 'closed' + else: + raise UserError(_('Please update your Return Date')) + + +class SessionType(models.Model): + _name = 'session.type' + + name = fields.Char(string='Name') diff --git a/studio_management/report/__init__.py b/studio_management/report/__init__.py new file mode 100644 index 000000000..25089aa6d --- /dev/null +++ b/studio_management/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import report_parser \ No newline at end of file diff --git a/studio_management/report/report_parser.py b/studio_management/report/report_parser.py new file mode 100644 index 000000000..3e3fa7fc3 --- /dev/null +++ b/studio_management/report/report_parser.py @@ -0,0 +1,39 @@ +from datetime import date +from odoo import api, models + + +class ParticularReport(models.AbstractModel): + _name = 'report.studio_management.report_digital_studio' + + @api.model + def render_html(self, docids, data=None): + records = self.env['session.details'].search([]) + report_obj = self.env['report'] + report = report_obj._get_report_from_name('studio_management.report_digital_studio') + if data['form']['date_from'] and data['form']['date_to'] and data['form']['customer_id']: + records = self.env['session.details'].search([('customer_id', '=', data['form']['customer_id'][0]), + ('return_date', '>=', data['form']['date_from']), + ('return_date', '<=', data['form']['date_to'])]) + elif data['form']['date_from'] and data['form']['date_to']: + records = self.env['session.details'].search([('return_date', '>=', data['form']['date_from']), + ('return_date', '<=', data['form']['date_to'])]) + elif data['form']['date_to'] and data['form']['customer_id']: + records = self.env['session.details'].search([('customer_id', '=', data['form']['customer_id'][0]), + ('return_date', '<=', data['form']['date_to'])]) + elif data['form']['date_from'] and data['form']['customer_id']: + records = self.env['session.details'].search([('customer_id', '=', data['form']['customer_id'][0]), + ('return_date', '>=', data['form']['date_from'])]) + elif data['form']['date_from']: + records = self.env['session.details'].search([('return_date', '>=', data['form']['date_from'])]) + elif data['form']['date_to']: + records = self.env['session.details'].search([('return_date', '<=', data['form']['date_to'])]) + elif data['form']['customer_id']: + records = self.env['session.details'].search([('customer_id', '=', data['form']['customer_id'][0])]) + docargs = { + 'doc_ids': docids, + 'doc_model': report.model, + 'records': records, + 'date_cur': date.today(), + 'docs': self, + } + return report_obj.render('studio_management.report_digital_studio', docargs) diff --git a/studio_management/report/report_template.xml b/studio_management/report/report_template.xml new file mode 100644 index 000000000..87ffde863 --- /dev/null +++ b/studio_management/report/report_template.xml @@ -0,0 +1,56 @@ + + + + \ No newline at end of file diff --git a/studio_management/security/ir.model.access.csv b/studio_management/security/ir.model.access.csv new file mode 100644 index 000000000..4c6440e26 --- /dev/null +++ b/studio_management/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 +acess_session_details,acess.session.details,studio_management.model_session_details,base.group_user,1,1,1,1 +acess_editing_works_manager,acess.editing.works,studio_management.model_editing_works,studio_management.studio_manager_groups,1,1,1,1 +acess_editing_works_designer,acess.editing.works,studio_management.model_editing_works,studio_management.studio_designer_groups,1,1,1,1 +acess_editing_works_staff,acess.editing.works,studio_management.model_editing_works,studio_management.studio_staff_groups,1,0,0,0 +acess_session_type,acess.session.type,studio_management.model_session_type,studio_management.studio_manager_groups,1,1,1,1 +acess_session_type_user,acess.session.type,studio_management.model_session_type,studio_management.studio_staff_groups,1,0,0,0 +acess_session_type_designer,acess.session.type,studio_management.model_session_type,studio_management.studio_designer_groups,1,0,0,0 diff --git a/studio_management/security/studio_security.xml b/studio_management/security/studio_security.xml new file mode 100644 index 000000000..2f7e19287 --- /dev/null +++ b/studio_management/security/studio_security.xml @@ -0,0 +1,24 @@ + + + + + Studio Management + Helps you manage studio + + + + Manager + + + + + Designer + + + + + Photographer + + + + \ No newline at end of file diff --git a/studio_management/static/description/banner.jpg b/studio_management/static/description/banner.jpg new file mode 100644 index 000000000..b80794998 Binary files /dev/null and b/studio_management/static/description/banner.jpg differ diff --git a/studio_management/static/description/cybro_logo.png b/studio_management/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/studio_management/static/description/cybro_logo.png differ diff --git a/studio_management/static/description/icon.png b/studio_management/static/description/icon.png new file mode 100644 index 000000000..93c06debb Binary files /dev/null and b/studio_management/static/description/icon.png differ diff --git a/studio_management/static/description/index.html b/studio_management/static/description/index.html new file mode 100644 index 000000000..592c0eed3 --- /dev/null +++ b/studio_management/static/description/index.html @@ -0,0 +1,125 @@ +
+
+

Helps to manage digital studio with different user levels

+ +

Cybrosys Technologies

+
+

Features:

+
    +
  •    Create and manage customer records
  • +
  •    Keep record of sessions
  • +
  •    Keep record of every work done by designers
  • +
  •    Reports of sessions based on customers or date
  • +
+
+
+
+ +
+
+
+

Overview

+

+ This module helps you to manage your daily studio activities +

+
+
+
+ +
+
+

Session Form View

+
+

+ ☛ Add details of a session with customers
+

+
+ +
+
+
+
+ +
+
+

Editing View

+
+

+ ☛ View the editing done by all users.
+ +

+
+ +
+
+
+
+ +
+
+

Reports

+
+

+ ☛ Print reports of all session based on customer or date.
+

+
+ +
+
+
+
+ +
+
+

User Form View

+
+

+ ☛ New groups added to user form under the new category Studio Management.
+ +

+
+ +
+
+
+
+ +
+
+

Customer Details

+
+

+ ☛ Keep record for all the customer details.
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/studio_management/static/description/studio_customers.png b/studio_management/static/description/studio_customers.png new file mode 100644 index 000000000..d20cb322a Binary files /dev/null and b/studio_management/static/description/studio_customers.png differ diff --git a/studio_management/static/description/studio_editing.png b/studio_management/static/description/studio_editing.png new file mode 100644 index 000000000..f4b161d6e Binary files /dev/null and b/studio_management/static/description/studio_editing.png differ diff --git a/studio_management/static/description/studio_groups.png b/studio_management/static/description/studio_groups.png new file mode 100644 index 000000000..75c9419b9 Binary files /dev/null and b/studio_management/static/description/studio_groups.png differ diff --git a/studio_management/static/description/studio_reports.png b/studio_management/static/description/studio_reports.png new file mode 100644 index 000000000..b04c0a931 Binary files /dev/null and b/studio_management/static/description/studio_reports.png differ diff --git a/studio_management/static/description/studio_session.png b/studio_management/static/description/studio_session.png new file mode 100644 index 000000000..c72148f99 Binary files /dev/null and b/studio_management/static/description/studio_session.png differ diff --git a/studio_management/views/editing_works.xml b/studio_management/views/editing_works.xml new file mode 100644 index 000000000..84b4cd5d9 --- /dev/null +++ b/studio_management/views/editing_works.xml @@ -0,0 +1,59 @@ + + + + + editing.works.form + editing.works + +
+
+ +
+ +
+

+ +

+
+ + + + + + + + + + + +
+
+
+
+ + + editing.works.tree + editing.works + + + + + + + + + + + + Editing Works + editing.works + form + tree,form + +

+ View Your Editing Works +

+
+
+
+
diff --git a/studio_management/views/session_type.xml b/studio_management/views/session_type.xml new file mode 100644 index 000000000..e748dd215 --- /dev/null +++ b/studio_management/views/session_type.xml @@ -0,0 +1,42 @@ + + + + + session.type.form + session.type + +
+ +
+

+ +

+
+
+
+
+
+ + + session.type.tree + session.type + + + + + + + + + Studio Types + session.type + form + tree,form + +

+ Create a new session type here +

+
+
+
+
diff --git a/studio_management/views/session_view.xml b/studio_management/views/session_view.xml new file mode 100644 index 000000000..a0bed5f25 --- /dev/null +++ b/studio_management/views/session_view.xml @@ -0,0 +1,76 @@ + + + + + session.details.form + session.details + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + session.details.tree + session.details + + + + + + + + + + + + Studio Session + session.details + form + tree,form + +

+ Create a new session for customers +

+
+
+
+
diff --git a/studio_management/views/studio_report.xml b/studio_management/views/studio_report.xml new file mode 100644 index 000000000..54e3f1547 --- /dev/null +++ b/studio_management/views/studio_report.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/studio_management/views/studio_sequence.xml b/studio_management/views/studio_sequence.xml new file mode 100644 index 000000000..b3cd74ac3 --- /dev/null +++ b/studio_management/views/studio_sequence.xml @@ -0,0 +1,20 @@ + + + + + Session Details + session.details + SD + 3 + + + + + Editing Works + editing.works + Edit + 3 + + + + \ No newline at end of file diff --git a/studio_management/views/studio_views.xml b/studio_management/views/studio_views.xml new file mode 100644 index 000000000..048badcd3 --- /dev/null +++ b/studio_management/views/studio_views.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + diff --git a/studio_management/wizard/__init__.py b/studio_management/wizard/__init__.py new file mode 100644 index 000000000..50bd7a5d7 --- /dev/null +++ b/studio_management/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import studio_report_wizard diff --git a/studio_management/wizard/studio_report_wizard.py b/studio_management/wizard/studio_report_wizard.py new file mode 100644 index 000000000..6b88e7cc0 --- /dev/null +++ b/studio_management/wizard/studio_report_wizard.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models, fields, api + + +class ReportWizard(models.TransientModel): + _name = 'studio.report.wizard' + + date_from = fields.Datetime(string='From') + date_to = fields.Datetime(string='To') + customer_id = fields.Many2one('res.partner', string='Customer') + + @api.multi + def print_reports(self): + if self._context is None: + context = {} + data = self.read()[0] + datas = { + 'ids': self._context.get('active_ids', []), + 'model': 'studio.report.wizard', + 'form': data, + } + datas['form']['active_ids'] = self._context.get('active_ids', False) + return self.env['report'].get_action(self, 'studio_management.report_digital_studio', data=datas) diff --git a/studio_management/wizard/studio_report_wizard.xml b/studio_management/wizard/studio_report_wizard.xml new file mode 100644 index 000000000..c7c701784 --- /dev/null +++ b/studio_management/wizard/studio_report_wizard.xml @@ -0,0 +1,36 @@ + + + + + Studio Reports + studio.report.wizard + +
+ + + + + + + + + +
+
+
+
+
+ + +
+
\ No newline at end of file