Browse Source

[ADD] Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
c4286c2e55
  1. 26
      studio_management/__init__.py
  2. 53
      studio_management/__manifest__.py
  3. 23
      studio_management/models/__init__.py
  4. 20
      studio_management/models/editing_works.py
  5. 43
      studio_management/models/session_model.py
  6. 23
      studio_management/report/__init__.py
  7. 39
      studio_management/report/report_parser.py
  8. 56
      studio_management/report/report_template.xml
  9. 8
      studio_management/security/ir.model.access.csv
  10. 24
      studio_management/security/studio_security.xml
  11. BIN
      studio_management/static/description/banner.jpg
  12. BIN
      studio_management/static/description/cybro_logo.png
  13. BIN
      studio_management/static/description/icon.png
  14. 125
      studio_management/static/description/index.html
  15. BIN
      studio_management/static/description/studio_customers.png
  16. BIN
      studio_management/static/description/studio_editing.png
  17. BIN
      studio_management/static/description/studio_groups.png
  18. BIN
      studio_management/static/description/studio_reports.png
  19. BIN
      studio_management/static/description/studio_session.png
  20. 59
      studio_management/views/editing_works.xml
  21. 42
      studio_management/views/session_type.xml
  22. 76
      studio_management/views/session_view.xml
  23. 11
      studio_management/views/studio_report.xml
  24. 20
      studio_management/views/studio_sequence.xml
  25. 51
      studio_management/views/studio_views.xml
  26. 23
      studio_management/wizard/__init__.py
  27. 44
      studio_management/wizard/studio_report_wizard.py
  28. 36
      studio_management/wizard/studio_report_wizard.xml

26
studio_management/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import models
import wizard
import report

53
studio_management/__manifest__.py

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

23
studio_management/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import session_model, editing_works

20
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)

43
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')

23
studio_management/report/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_parser

39
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)

56
studio_management/report/report_template.xml

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_digital_studio">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<div class="page" >
<div class="row mt32 mb32" style="text-align:left;">
<div class="col-xs-12">
User :
<p t-esc="user.name"/>
</div>
</div>
<div class="row mt32 mb32" style="text-align:left;">
<div class="col-xs-12">
Date :
<p t-esc="date_cur"/>
</div>
</div>
<table class="table table-condensed">
<thead>
<tr >
<th style="background-color:#9b9da0 !important;">Name</th>
<th style="background-color:#9b9da0 !important;">Customer</th>
<th style="background-color:#9b9da0 !important;">Type</th>
<th style="background-color:#9b9da0 !important;">Return Date</th>
<th style="background-color:#9b9da0 !important;">State</th>
</tr>
</thead>
<tbody>
<t t-foreach="records" t-as="rec">
<tr>
<td>
<span t-att-style="style" t-esc="rec.name"/>
</td>
<td>
<span t-att-style="style" t-esc="rec.customer_id.name"/>
</td>
<td>
<span t-att-style="style" t-esc="rec.type_id.name"/>
</td>
<td>
<span t-att-style="style" t-esc="rec.return_date"/>
</td>
<td>
<span t-att-style="style" t-esc="rec.state"/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
</t>
</t>
</template>
</odoo>

8
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 acess_session_details acess.session.details studio_management.model_session_details base.group_user 1 1 1 1
3 acess_editing_works_manager acess.editing.works studio_management.model_editing_works studio_management.studio_manager_groups 1 1 1 1
4 acess_editing_works_designer acess.editing.works studio_management.model_editing_works studio_management.studio_designer_groups 1 1 1 1
5 acess_editing_works_staff acess.editing.works studio_management.model_editing_works studio_management.studio_staff_groups 1 0 0 0
6 acess_session_type acess.session.type studio_management.model_session_type studio_management.studio_manager_groups 1 1 1 1
7 acess_session_type_user acess.session.type studio_management.model_session_type studio_management.studio_staff_groups 1 0 0 0
8 acess_session_type_designer acess.session.type studio_management.model_session_type studio_management.studio_designer_groups 1 0 0 0

24
studio_management/security/studio_security.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="category_studio_management" model="ir.module.category">
<field name="name">Studio Management</field>
<field name="description">Helps you manage studio</field>
</record>
<record id="studio_manager_groups" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="category_studio_management"/>
</record>
<record id="studio_designer_groups" model="res.groups">
<field name="name">Designer</field>
<field name="category_id" ref="category_studio_management"/>
</record>
<record id="studio_staff_groups" model="res.groups">
<field name="name">Photographer</field>
<field name="category_id" ref="category_studio_management"/>
</record>
</data>
</odoo>

BIN
studio_management/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
studio_management/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
studio_management/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

125
studio_management/static/description/index.html

@ -0,0 +1,125 @@
<section class="oe_container">
<div class="oe_spaced">
<h2 class="oe_slogan">Helps to manage digital studio with different user levels</h2>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
<div style="padding-left:66px;">
<h4>Features:</h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Create and manage customer records</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Keep record of sessions</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Keep record of every work done by designers</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Reports of sessions based on customers or date</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">
This module helps you to manage your daily studio activities
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Session Form View</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; Add details of a session with customers<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="studio_session.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Editing View</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; View the editing done by all users.<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="studio_editing.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Reports</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; Print reports of all session based on customer or date.<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="studio_reports.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">User Form View</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; New groups added to user form under the new category Studio Management.<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="studio_groups.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h4 class="oe_slogan">Customer Details</h4>
<div class="oe_span12">
<p class='oe_mt32'>
&#x261B; Keep record for all the customer details.<br>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="studio_customers.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<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
studio_management/static/description/studio_customers.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
studio_management/static/description/studio_editing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
studio_management/static/description/studio_groups.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
studio_management/static/description/studio_reports.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
studio_management/static/description/studio_session.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

59
studio_management/views/editing_works.xml

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="editing_works_form" model="ir.ui.view">
<field name="name">editing.works.form</field>
<field name="model">editing.works</field>
<field name="arch" type="xml">
<form string="Editing Works" create="false" edit="false">
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="work_done"/>
<field name="time_taken" widget="float_time"/>
</group>
<group>
<field name="session_id"/>
<field name="work_by"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="editing_works_tree" model="ir.ui.view">
<field name="name">editing.works.tree</field>
<field name="model">editing.works</field>
<field name="arch" type="xml">
<tree string="Editing Works" create="false" edit="false">
<field name="name"/>
<field name="work_by"/>
<field name="time_taken" widget="float_time"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_editing_works" model="ir.actions.act_window">
<field name="name">Editing Works</field>
<field name="res_model">editing.works</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">
View Your Editing Works
</p>
</field>
</record>
</data>
</odoo>

42
studio_management/views/session_type.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="studio_session_type_form" model="ir.ui.view">
<field name="name">session.type.form</field>
<field name="model">session.type</field>
<field name="arch" type="xml">
<form string="Sessions">
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
</sheet>
</form>
</field>
</record>
<record id="studio_session_type_tree" model="ir.ui.view">
<field name="name">session.type.tree</field>
<field name="model">session.type</field>
<field name="arch" type="xml">
<tree string="Session Type">
<field name="name"/>
</tree>
</field>
</record>
<record id="action_session_type" model="ir.actions.act_window">
<field name="name">Studio Types</field>
<field name="res_model">session.type</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">
Create a new session type here
</p>
</field>
</record>
</data>
</odoo>

76
studio_management/views/session_view.xml

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="studio_session_form" model="ir.ui.view">
<field name="name">session.details.form</field>
<field name="model">session.details</field>
<field name="arch" type="xml">
<form string="Sessions">
<header>
<button name="submit_session" string="Submit" type="object" states="draft" class="btn-primary"/>
<button name="close_session" string="Close" type="object" states="design" class="btn-primary"
groups="base.group_system,studio_management.studio_manager_groups,studio_management.studio_designer_groups"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="customer_id" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="type_id" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</group>
<group>
<field name="order_date" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="return_date"/>
</group>
</group>
<notebook>
<page string="Editing Works">
<field name="editing_work_id" attrs="{'readonly': [('state', '!=', 'design')]}">
<tree string="Editing Works" editable="bottom">
<field name="work_done"/>
<field name="work_by"/>
<field name="time_taken" widget="float_time"/>
<field name="state"/>
</tree>
</field>
</page>
<page string="Extra Notes">
<field name="note_field"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="studio_session_tree" model="ir.ui.view">
<field name="name">session.details.tree</field>
<field name="model">session.details</field>
<field name="arch" type="xml">
<tree string="Sessions">
<field name="name"/>
<field name="customer_id"/>
<field name="type_id"/>
<field name="return_date"/>
</tree>
</field>
</record>
<record id="action_studio_session" model="ir.actions.act_window">
<field name="name">Studio Session</field>
<field name="res_model">session.details</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">
Create a new session for customers
</p>
</field>
</record>
</data>
</odoo>

11
studio_management/views/studio_report.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report
id="digital_studio_report"
model="studio.report.wizard"
string="Get report"
report_type="qweb-pdf"
name="studio_management.report_digital_studio"
file="studio_management.report_digital_studio"
/>
</odoo>

20
studio_management/views/studio_sequence.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="seq_session_details" model="ir.sequence">
<field name="name">Session Details</field>
<field name="code">session.details</field>
<field name="prefix">SD</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
<record id="seq_editing_works" model="ir.sequence">
<field name="name">Editing Works</field>
<field name="code">editing.works</field>
<field name="prefix">Edit</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
</data>
</odoo>

51
studio_management/views/studio_views.xml

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem
id="studio_main"
name="Studio"/>
<menuitem
id="studio_main_menu"
name="Studio"
parent="studio_main"/>
<menuitem
id="customer_management_menu"
name="Customers"
parent="studio_main_menu"
action="base.action_partner_customer_form"/>
<menuitem
id="session_management_menu"
name="Session"
parent="studio_main_menu"
action="action_studio_session"/>
<menuitem
id="editing_menu"
name="Editing"
parent="studio_main_menu"
action="action_editing_works"
groups="base.group_system,studio_management.studio_manager_groups"/>
<menuitem
id="reports_main_menu"
name="Reports"
parent="studio_main"/>
<menuitem
id="reports_wizard_menu"
name="Reports"
parent="reports_main_menu"
action="launch_studio_report_wizard"
groups="base.group_system,studio_management.studio_manager_groups"/>
<menuitem
id="configuration_main_menu"
name="Configuration"
parent="studio_main"/>
<menuitem
id="session_type_menu"
name="Session Type"
parent="configuration_main_menu"
action="action_session_type"
groups="base.group_system,studio_management.studio_manager_groups"/>
</data>
</odoo>

23
studio_management/wizard/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import studio_report_wizard

44
studio_management/wizard/studio_report_wizard.py

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

36
studio_management/wizard/studio_report_wizard.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="studio_report_wizard" model="ir.ui.view">
<field name="name">Studio Reports</field>
<field name="model">studio.report.wizard</field>
<field name="arch" type="xml" >
<form>
<group>
<group>
<field name="date_from"/>
<field name="customer_id"/>
</group>
<group>
<field name="date_to"/>
</group>
</group>
<footer>
<button name="print_reports"
type="object"
string="Print"
class="oe_highlight"/>
or
<button special="cancel" string="Cancel"/>
</footer>
</form>
</field>
</record>
<act_window id="launch_studio_report_wizard"
name="Studio Reports"
res_model="studio.report.wizard"
view_mode="form"
target="new"/>
</data>
</odoo>
Loading…
Cancel
Save