diff --git a/pos_product_creation/README.rst b/pos_product_creation/README.rst new file mode 100644 index 000000000..eca16f8c5 --- /dev/null +++ b/pos_product_creation/README.rst @@ -0,0 +1,29 @@ +======================== +Pos Product Creation v11 +======================== + +This module adds product creation button an wizard in pos. + +Installation +============ + +Just select it from available modules to install it, there is no need to extra installations. + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Author +------ +Cybrosys Technologies + +Credits +======= +Developer V10: Linto CT @ cybrosys, odoo@cybrosys.com + V11: Akshay Babu, + diff --git a/pos_product_creation/__init__.py b/pos_product_creation/__init__.py new file mode 100644 index 000000000..acebb8062 --- /dev/null +++ b/pos_product_creation/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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 . import models diff --git a/pos_product_creation/__manifest__.py b/pos_product_creation/__manifest__.py new file mode 100644 index 000000000..ab84b2a77 --- /dev/null +++ b/pos_product_creation/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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': 'Create Products From POS', + 'version': '11.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Create Products From POS Interface', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.png'], + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': [ + 'views/pos_template.xml', + ], + 'qweb': ['static/src/xml/pos.xml'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/pos_product_creation/doc/RELEASE_NOTES.md b/pos_product_creation/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..ccdb167e1 --- /dev/null +++ b/pos_product_creation/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 14.05.2019 +#### Version 11.0.1.0.0 +##### ADD +- Initial Commit Create Products From POS Interface diff --git a/pos_product_creation/models/__init__.py b/pos_product_creation/models/__init__.py new file mode 100644 index 000000000..aa4fd0340 --- /dev/null +++ b/pos_product_creation/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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 . import product_pos diff --git a/pos_product_creation/models/product_pos.py b/pos_product_creation/models/product_pos.py new file mode 100644 index 000000000..57ec9814d --- /dev/null +++ b/pos_product_creation/models/product_pos.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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, api + + +class ProductFromPos(models.Model): + _inherit = 'product.product' + + @api.model + def create_product_pos(self, vals): + type = None + if vals.get('type') == 'Stockable': + type = 'product' + elif vals.get('type') == 'Consumable': + type = 'consu' + elif vals.get('type') == 'Service': + type = 'service' + category = self.env['product.category'].search([('name', '=', vals.get('category'))], limit=1) + uom_id = self.env['product.uom'].search([('name', '=', vals.get('unit'))], limit=1) + new_vals = { + 'name': vals.get('name'), + 'display_name': vals.get('name'), + 'type': type, + 'categ_id': category.id if category else None, + 'list_price': vals.get('price') if vals.get('price') else 1, + 'available_in_pos': True, + 'sale_ok': True, + 'uom_id': uom_id.id, + 'uom_po_id': uom_id.id + } + rec = self.env['product.product'].create(new_vals) + new_vals['id'] = rec.id + new_vals['lst_price'] = vals.get('price') if vals.get('price') else 1 + new_vals['standard_price'] = vals.get('price') if vals.get('price') else 1 + new_vals['pos_categ_id'] = [rec.pos_categ_id.id] if rec.pos_categ_id else None + new_vals['taxes_id'] = [rec.taxes_id.id] if rec.taxes_id else [] + new_vals['barcode'] = rec.barcode + new_vals['default_code'] = rec.default_code + new_vals['to_weight'] = rec.to_weight + new_vals['uom_id'] = [rec.uom_id.id, rec.uom_id.name] + new_vals['description_sale'] = rec.description_sale + new_vals['description'] = rec.description + new_vals['product_tmpl_id'] = [rec.product_tmpl_id.id] + new_vals['tracking'] = rec.tracking + + return new_vals \ No newline at end of file diff --git a/pos_product_creation/static/description/banner.png b/pos_product_creation/static/description/banner.png new file mode 100644 index 000000000..b732ff64f Binary files /dev/null and b/pos_product_creation/static/description/banner.png differ diff --git a/pos_product_creation/static/description/cybro_logo.png b/pos_product_creation/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_product_creation/static/description/cybro_logo.png differ diff --git a/pos_product_creation/static/description/icon.png b/pos_product_creation/static/description/icon.png new file mode 100644 index 000000000..0af712288 Binary files /dev/null and b/pos_product_creation/static/description/icon.png differ diff --git a/pos_product_creation/static/description/index.html b/pos_product_creation/static/description/index.html new file mode 100644 index 000000000..2bb7879ef --- /dev/null +++ b/pos_product_creation/static/description/index.html @@ -0,0 +1,333 @@ + +
+
+

+ POS Product Creation +

+

+ Create Products From POS +

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

+ Overview +

+

+ The module provisions the end user to create products directly from Point of Sale. The new button "Add Product", shall enable the end user to add details such as product name, type, category price and more from POS. Upon clicking the confirm button, a new product shall be created based on provided details. + +

+
+
+ +
+
+

+ Features +

+

+ + Allows you to create products from Point of Sale +

+ +
+
+ +
+
+

+ Screenshots +

+

+ + Enter the details of products. +

+
+ +
+

+ + The products list will be updated real time. It is not needed to reload the page to show the newly created product in Point of Sale products list. +

+
+ +
+ +
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

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

+ + Trading + +

+

+ Easily procure and sell your products. +

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

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

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

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

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

+ + POS +

+

+ Easy configuring and convivial selling. +

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

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

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

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

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

+ + Education +

+

+ A Collaborative platform for educational management. +

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

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/pos_product_creation/static/description/pos-product-cybrosys-1.png b/pos_product_creation/static/description/pos-product-cybrosys-1.png new file mode 100644 index 000000000..d087f7624 Binary files /dev/null and b/pos_product_creation/static/description/pos-product-cybrosys-1.png differ diff --git a/pos_product_creation/static/description/pos-product-cybrosys-2.png b/pos_product_creation/static/description/pos-product-cybrosys-2.png new file mode 100644 index 000000000..7fca8955d Binary files /dev/null and b/pos_product_creation/static/description/pos-product-cybrosys-2.png differ diff --git a/pos_product_creation/static/description/product.png b/pos_product_creation/static/description/product.png new file mode 100644 index 000000000..065db29fc Binary files /dev/null and b/pos_product_creation/static/description/product.png differ diff --git a/pos_product_creation/static/description/wizard.png b/pos_product_creation/static/description/wizard.png new file mode 100644 index 000000000..108e39604 Binary files /dev/null and b/pos_product_creation/static/description/wizard.png differ diff --git a/pos_product_creation/static/src/js/create_product.js b/pos_product_creation/static/src/js/create_product.js new file mode 100644 index 000000000..077941793 --- /dev/null +++ b/pos_product_creation/static/src/js/create_product.js @@ -0,0 +1,94 @@ +odoo.define('pos_product_creation',function(require) { + +var gui = require('point_of_sale.gui'); +var chrome = require('point_of_sale.chrome'); +var PopupWidget = require('point_of_sale.popups'); +var popups = require('point_of_sale.popups'); +var core = require('web.core'); +var models = require('point_of_sale.models'); +var rpc = require('web.rpc'); +var QWeb = core.qweb; +var _t = core._t; + + +chrome.OrderSelectorWidget.include({ + renderElement: function(){ + var self = this; + this._super(); + var categ = []; + var unit = []; + for (var i in self.pos.product_categories){ + categ.push(self.pos.product_categories[i].name); + } + for (var i in self.pos.units){ + unit.push(self.pos.units[i].name); + } + this.$('.add-product').click(function(event){ + self.gui.show_popup('product_create',{ + 'category': categ, + 'units':unit, + }); + }); + }, +}); +var ProductCreationWidget = PopupWidget.extend({ + template: 'ProductCreationWidget', + init: function(parent, args) { + this._super(parent, args); + this.options = {}; + this.category = []; + this.units = []; + }, + events: { + 'click .button.cancel': 'click_cancel', + 'click .button.confirm': 'click_confirm', + }, + show: function(options){ + options = options || {}; + this._super(options); + this.category = options.category; + this.units = options.units; + this.renderElement(); + this.$('.name').focus(); + }, + click_confirm: function(){ + var self = this; + var name = this.$('.name').val(); + var type = this.$('.type').val(); + var category = this.$('.category').val(); + var unit = this.$('.uom').val(); + var price = this.$('.price').val(); + if(!name || !price) { + alert("Please fill Name & price for the Product!") + } + else { + var product_vals = { + 'name': name, + 'type': type, + 'category': category, + 'price': price, + 'unit': unit + }; + rpc.query({ + model: 'product.product', + method: 'create_product_pos', + args: [product_vals], + }).then(function (products){ + self.pos.db.add_products(_.map([products], function (product) { + product.categ = _.findWhere(self.pos.product_categories, {'id': product.categ_id[0]}); + return new models.Product({}, product); + })); + }); + this.gui.close_popup(); + } + }, + click_cancel: function(){ + this.gui.close_popup(); + if (this.options.cancel) { + this.options.cancel.call(this); + } + }, +}); +gui.define_popup({name:'product_create', widget: ProductCreationWidget}); + +}); \ No newline at end of file diff --git a/pos_product_creation/static/src/xml/pos.xml b/pos_product_creation/static/src/xml/pos.xml new file mode 100644 index 000000000..cb482ad49 --- /dev/null +++ b/pos_product_creation/static/src/xml/pos.xml @@ -0,0 +1,54 @@ + + + + +
+ + Add Product + +
+
+
+ + + + +
\ No newline at end of file diff --git a/pos_product_creation/views/pos_template.xml b/pos_product_creation/views/pos_template.xml new file mode 100644 index 000000000..9932b9edf --- /dev/null +++ b/pos_product_creation/views/pos_template.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/project_report_pdf/README.rst b/project_report_pdf/README.rst new file mode 100644 index 000000000..895ccf762 --- /dev/null +++ b/project_report_pdf/README.rst @@ -0,0 +1,23 @@ +Project Report v11 +================== +PDF and XLS Reports for Project Module. + + +Features +======== +* Project Tasks Report XLS [With advanced Filtration] +* Project Tasks Report PDF [With advanced Filtration] + +Installation +============ +To install this module, you need also the **report_xlsx** + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Developer V9: Avinash Nk @ cybrosys +* Developer V10: Treesa @ cybrosys +* Developer V11: Akshay diff --git a/project_report_pdf/__init__.py b/project_report_pdf/__init__.py new file mode 100644 index 000000000..d768f66c3 --- /dev/null +++ b/project_report_pdf/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import wizard +from . import report + diff --git a/project_report_pdf/__manifest__.py b/project_report_pdf/__manifest__.py new file mode 100644 index 000000000..abe04df85 --- /dev/null +++ b/project_report_pdf/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Project Report XLS & PDF', + 'version': '11.0.2.0.0', + "category": "Project", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'summary': """Advanced PDF & XLS Reports for Project With Filtrations""", + 'depends': ['base', 'project', 'report_xlsx'], + 'license': 'AGPL-3', + 'data': [ + 'wizard/project_report_wizard_view.xml', + 'report/project_report_pdf_view.xml', + 'views/project_report_button.xml', + 'views/project_report.xml' + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/project_report_pdf/doc/RELEASE_NOTES.md b/project_report_pdf/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..568add4a5 --- /dev/null +++ b/project_report_pdf/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 07.05.2019 +#### Version 11.0.1.0.0 +##### ADD +- Initial Commit Advanced PDF & XLS Reports for Project With Filtrations diff --git a/project_report_pdf/report/__init__.py b/project_report_pdf/report/__init__.py new file mode 100644 index 000000000..bb158a57c --- /dev/null +++ b/project_report_pdf/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import project_report_pdf +from . import project_report_xls diff --git a/project_report_pdf/report/project_report_pdf.py b/project_report_pdf/report/project_report_pdf.py new file mode 100644 index 000000000..2fa18e5ba --- /dev/null +++ b/project_report_pdf/report/project_report_pdf.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo.http import request +from odoo import models, api + + +class ProjectReportParser(models.AbstractModel): + _name = 'report.project_report_pdf.project_report_template' + + def get_report_values(self, docids, data=None): + name = data['record'] + wizard_record = request.env['wizard.project.report'].search([])[-1] + task_obj = request.env['project.task'] + users_selected = [] + stages_selected = [] + for elements in wizard_record.partner_select: + users_selected.append(elements.id) + for elements in wizard_record.stage_select: + stages_selected.append(elements.id) + if wizard_record.partner_select: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected), + ('stage_id', 'in', stages_selected)]) + + else: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected)]) + + else: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('stage_id', 'in', stages_selected)]) + else: + current_task = task_obj.search([('project_id', '=', name)]) + vals = [] + for i in current_task: + vals.append({ + 'name': i.name, + 'user_id': i.user_id.name, + 'stage_id': i.stage_id.name, + }) + return { + 'vals': vals, + 'name': current_task[0].project_id.name, + 'manager': current_task[0].project_id.user_id.name, + 'date_start': current_task[0].project_id.date_start, + 'date_end': current_task[0].project_id.date, + } + + + + diff --git a/project_report_pdf/report/project_report_pdf_view.xml b/project_report_pdf/report/project_report_pdf_view.xml new file mode 100644 index 000000000..90fedb33a --- /dev/null +++ b/project_report_pdf/report/project_report_pdf_view.xml @@ -0,0 +1,44 @@ + + + + \ No newline at end of file diff --git a/project_report_pdf/report/project_report_xls.py b/project_report_pdf/report/project_report_xls.py new file mode 100644 index 000000000..94d8e9f1b --- /dev/null +++ b/project_report_pdf/report/project_report_xls.py @@ -0,0 +1,125 @@ + # -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo.http import request +from odoo import models, api + + +class ProjectReportXls(models.AbstractModel): + _name = 'report.project_report_pdf.project_xlsx' + _inherit = 'report.report_xlsx.abstract' + + def generate_xlsx_report(self, workbook, data, lines): + print('kskskjajaajaj') + name = data['record'] + print(lines) + print(data['context']['uid']) + user_obj = self.env['res.users'].search([('id', '=', data['context']['uid'])]) + print(user_obj.company_id) + wizard_record = request.env['wizard.project.report'].search([])[-1] + task_obj = request.env['project.task'] + users_selected = [] + stages_selected = [] + for elements in wizard_record.partner_select: + users_selected.append(elements.id) + for elements in wizard_record.stage_select: + stages_selected.append(elements.id) + if wizard_record.partner_select: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected), + ('stage_id', 'in', stages_selected)]) + + else: + current_task = task_obj.search([('project_id', '=', name), + ('user_id', 'in', users_selected)]) + + else: + if wizard_record.stage_select: + current_task = task_obj.search([('project_id', '=', name), + ('stage_id', 'in', stages_selected)]) + else: + current_task = task_obj.search([('project_id', '=', name)]) + vals = [] + for i in current_task: + vals.append({ + 'name': i.name, + 'user_id': i.user_id.name if i.user_id.name else '', + 'stage_id': i.stage_id.name, + }) + print(vals, 'vals') + + sheet = workbook.add_worksheet("Project Report") + format1 = workbook.add_format({'font_size': 22, 'bg_color': '#D3D3D3'}) + format4 = workbook.add_format({'font_size': 22}) + format2 = workbook.add_format({'font_size': 12, 'bold': True, 'bg_color': '#D3D3D3'}) + format3 = workbook.add_format({'font_size': 10}) + format5 = workbook.add_format({'font_size': 10, 'bg_color': '#FFFFFF'}) + format7 = workbook.add_format({'font_size': 10, 'bg_color': '#FFFFFF'}) + format6 = workbook.add_format({'font_size': 22, 'bg_color': '#FFFFFF'}) + format7.set_align('center') + sheet.merge_range('A1:B1', user_obj.company_id.name, format5) + sheet.merge_range('A2:B2', user_obj.company_id.street, format5) + sheet.write('A3', user_obj.company_id.city, format5) + sheet.write('B3', user_obj.company_id.zip, format5) + sheet.merge_range('A4:B4', user_obj.company_id.state_id.name, format5) + sheet.merge_range('A5:B5', user_obj.company_id.country_id.name, format5) + sheet.merge_range('C1:H5', "", format5) + sheet.merge_range(5, 0, 6, 1, "Project :", format1) + sheet.merge_range(5, 2, 6, 7, current_task[0].project_id.name, format1) + sheet.merge_range('A8:B8', "Project Manager :", format5) + sheet.merge_range('C8:D8', current_task[0].project_id.user_id.name, format5) + date_start = '' + date_end = '' + if current_task[0].project_id.date_start: + date_start = str(current_task[0].project_id.date_start) + if current_task[0].project_id.date: + date_end = str(current_task[0].project_id.date) + sheet.merge_range('A9:B9', "Start Date :", format5) + sheet.merge_range('C9:D9', date_start, format5) + sheet.merge_range('A10:B10', "End Date :", format5) + sheet.merge_range('C10:D10', date_end, format5) + sheet.merge_range(0, 2, 4, 5, "", format5) + sheet.merge_range(1, 6, 4, 7, "", format5) + sheet.merge_range(7, 4, 9, 7, "", format5) + + sheet.merge_range(10, 4, 11, 7, "", format5) + sheet.merge_range('A11:H12', 'Open Tasks', format4) + + sheet.merge_range('A13:D13', "Tasks", format2) + sheet.merge_range('E13:F13', "Assigned", format2) + sheet.merge_range('G13:H13', "Stage", format2) + row_number = 13 + column_number = 0 + for val in vals: + sheet.merge_range(row_number, column_number, row_number, column_number+3, val['name'], format3) + sheet.merge_range(row_number, column_number+4, row_number, column_number+5, val['user_id'], format3) + sheet.merge_range(row_number, column_number+6, row_number, column_number+7, val['stage_id'], format3) + row_number += 1 + + row_number += 1 + sheet.merge_range(row_number, 0, row_number, 1, user_obj.company_id.phone, format7) + sheet.merge_range(row_number, 2, row_number, 4, user_obj.company_id.email, format7) + sheet.merge_range(row_number, 5, row_number, 7, user_obj.company_id.website, format7) + + + + diff --git a/project_report_pdf/static/description/banner.png b/project_report_pdf/static/description/banner.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/project_report_pdf/static/description/banner.png differ diff --git a/project_report_pdf/static/description/cybro_logo.png b/project_report_pdf/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/project_report_pdf/static/description/cybro_logo.png differ diff --git a/project_report_pdf/static/description/icon.png b/project_report_pdf/static/description/icon.png new file mode 100644 index 000000000..954404fbd Binary files /dev/null and b/project_report_pdf/static/description/icon.png differ diff --git a/project_report_pdf/static/description/index.html b/project_report_pdf/static/description/index.html new file mode 100644 index 000000000..c31ed3856 --- /dev/null +++ b/project_report_pdf/static/description/index.html @@ -0,0 +1,355 @@ +
+
+

+ Project Report PDF & XLS +

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

+ Overview +

+

+ This module enhances the project management with intuitive reports. + Reports consist of task details with respect to the selected project. + The user can use the filter facilities from report wizard to get the optimized reports. +

+
+
+ +
+
+

+ Features +

+

+ + PDF Reports in Project. +

+

+ + XLS Reports in Project. +

+

+ + Detailed Report on Tasks. +

+

+ + Advanced Filters for Report. +

+
+
+ +
+
+

+ Screenshots +

+

+ + Go to Project -> Project +

+
+ +
+

+ + You can filter the project report via selecting the appropriate options from the wizard. +

+
+ +
+

+ + PDF Report Of Data Import/Export Plugin Project. +

+
+ +
+

+ + Excel Report Of Data Import/Export Plugin Project. +

+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

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

+ + Trading + +

+

+ Easily procure and sell your products. +

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

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

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

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

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

+ + POS +

+

+ Easy configuring and convivial selling. +

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

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

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

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

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

+ + Education +

+

+ A Collaborative platform for educational management. +

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

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/project_report_pdf/static/description/project-report-cybrosys-1.png b/project_report_pdf/static/description/project-report-cybrosys-1.png new file mode 100644 index 000000000..152b2a7b6 Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-1.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-2.png b/project_report_pdf/static/description/project-report-cybrosys-2.png new file mode 100644 index 000000000..36476d46f Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-2.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-3.png b/project_report_pdf/static/description/project-report-cybrosys-3.png new file mode 100644 index 000000000..3b88692d0 Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-3.png differ diff --git a/project_report_pdf/static/description/project-report-cybrosys-4.png b/project_report_pdf/static/description/project-report-cybrosys-4.png new file mode 100644 index 000000000..47bc70660 Binary files /dev/null and b/project_report_pdf/static/description/project-report-cybrosys-4.png differ diff --git a/project_report_pdf/views/project_report.xml b/project_report_pdf/views/project_report.xml new file mode 100644 index 000000000..6ca78b423 --- /dev/null +++ b/project_report_pdf/views/project_report.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/project_report_pdf/views/project_report_button.xml b/project_report_pdf/views/project_report_button.xml new file mode 100644 index 000000000..1a2127ef6 --- /dev/null +++ b/project_report_pdf/views/project_report_button.xml @@ -0,0 +1,16 @@ + + + + + project_report_pdf_inherited.form + project.project + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/project_report_pdf/wizard/__init__.py b/project_report_pdf/wizard/__init__.py new file mode 100644 index 000000000..afa59e5e8 --- /dev/null +++ b/project_report_pdf/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import project_report_wizard diff --git a/project_report_pdf/wizard/project_report_wizard.py b/project_report_pdf/wizard/project_report_wizard.py new file mode 100644 index 000000000..c97d29dc1 --- /dev/null +++ b/project_report_pdf/wizard/project_report_wizard.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akshay Babu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, api, _ + + +class ProjectReportButton(models.TransientModel): + _name = 'wizard.project.report' + + + partner_select = fields.Many2many('res.users', string='Assigned to') + stage_select = fields.Many2many('project.task.type', string="Stage") + + @api.multi + def print_project_report_pdf(self): + + active_record = self._context['active_id'] + record = self.env['project.project'].browse(active_record) + + data = { + 'ids': self.ids, + 'model': self._name, + 'record': record.id, + } + return self.env.ref('project_report_pdf.report_project_pdf').report_action(self, data=data) + + @api.multi + def print_project_report_xls(self): + active_record = self._context['active_id'] + record = self.env['project.project'].browse(active_record) + + data = { + 'ids': self.ids, + 'model': self._name, + 'record': record.id, + } + return self.env.ref('project_report_pdf.project_xlsx').report_action(self, data=data) diff --git a/project_report_pdf/wizard/project_report_wizard_view.xml b/project_report_pdf/wizard/project_report_wizard_view.xml new file mode 100644 index 000000000..037db0f87 --- /dev/null +++ b/project_report_pdf/wizard/project_report_wizard_view.xml @@ -0,0 +1,36 @@ + + + + + report_wizard_view_form.form + wizard.project.report + +
+ + + + + + + + + + +
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/timesheets_by_employee/README.rst b/timesheets_by_employee/README.rst new file mode 100644 index 000000000..58b813c51 --- /dev/null +++ b/timesheets_by_employee/README.rst @@ -0,0 +1,30 @@ +Timesheets by Employees v11 +=========================== +This module allows to print the timesheets of selected employee. + +Installation +============ +No additional files neeeded. + +Configuration +============= + +No configurations needed. + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Author +------ +Cybrosys Technologies + + +Credits +======= +Developer: v11.0 Kavya Raveendran odoo@cybrosys.com, diff --git a/timesheets_by_employee/__init__.py b/timesheets_by_employee/__init__.py new file mode 100644 index 000000000..f3ab166d1 --- /dev/null +++ b/timesheets_by_employee/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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 . import report +from . import wizard diff --git a/timesheets_by_employee/__manifest__.py b/timesheets_by_employee/__manifest__.py new file mode 100644 index 000000000..43fad2033 --- /dev/null +++ b/timesheets_by_employee/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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': 'Timesheet PDF Report', + 'version': '11.0.1.0.0', + "category": "Generic Modules/Human Resources", + 'sequence': 25, + 'summary': 'Timesheet PDF Report of Employees', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['hr_timesheet'], + 'data': [ + 'report/report_timesheets.xml', + 'report/timesheet_pdf.xml', + 'wizard/timesheet_wizard.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/timesheets_by_employee/doc/RELEASE_NOTES.md b/timesheets_by_employee/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..4b38ac4f3 --- /dev/null +++ b/timesheets_by_employee/doc/RELEASE_NOTES.md @@ -0,0 +1,8 @@ +## Module + +#### 25.05.2019 +#### Version 11.0.1.0.0 +##### ADD + +- Initial Commit + diff --git a/timesheets_by_employee/report/__init__.py b/timesheets_by_employee/report/__init__.py new file mode 100644 index 000000000..7cb95bb77 --- /dev/null +++ b/timesheets_by_employee/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# 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 . import report_timesheets diff --git a/timesheets_by_employee/report/report_timesheets.py b/timesheets_by_employee/report/report_timesheets.py new file mode 100644 index 000000000..ff63c1378 --- /dev/null +++ b/timesheets_by_employee/report/report_timesheets.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# 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 ReportTimesheet(models.AbstractModel): + _name = 'report.timesheets_by_employee.report_timesheets' + + def get_timesheets(self, docs): + """input : name of employee and the starting date and ending date + output: timesheets by that particular employee within that period and the total duration""" + + if docs.from_date and docs.to_date: + rec = self.env['account.analytic.line'].search([('user_id', '=', docs.employee[0].id), + ('date', '>=', docs.from_date),('date', '<=', docs.to_date)]) + elif docs.from_date: + rec = self.env['account.analytic.line'].search([('user_id', '=', docs.employee[0].id), + ('date', '>=', docs.from_date)]) + elif docs.to_date: + rec = self.env['account.analytic.line'].search([('user_id', '=', docs.employee[0].id), + ('date', '<=', docs.to_date)]) + else: + rec = self.env['account.analytic.line'].search([('user_id', '=', docs.employee[0].id)]) + records = [] + total = 0 + for r in rec: + vals = {'project': r.project_id.name, + 'user': r.user_id.partner_id.name, + 'duration': r.unit_amount, + 'date': r.date, + } + total += r.unit_amount + records.append(vals) + return [records, total] + + @api.model + def get_report_values(self, docids, data=None): + """we are overwriting this function because we need to show values from other models in the report + we pass the objects in the docargs dictionary""" + self.model = self.env.context.get('active_model') + docs = self.env[self.model].browse(self.env.context.get('active_id')) + identification = [] + if self.env['hr.employee'].search([('user_id', '=', docs.employee[0].id)]) != '': + for i in self.env['hr.employee'].search([('user_id', '=', docs.employee[0].id)]): + if i: + identification.append({'id': i.id, 'name': i.name}) + else: + identification=[0]; + print(identification) + + timesheets = self.get_timesheets(docs) + period = None + if docs.from_date and docs.to_date: + period = "From " + str(docs.from_date) + " To " + str(docs.to_date) + elif docs.from_date: + period = "From " + str(docs.from_date) + elif docs.from_date: + period = " To " + str(docs.to_date) + + return { + 'doc_ids': self.ids, + 'doc_model': self.model, + 'docs': docs, + 'timesheets': timesheets[0], + 'total': timesheets[1], + 'company': docs.employee[0].company_id.name, + 'identification': identification, + 'period': period, + } diff --git a/timesheets_by_employee/report/report_timesheets.xml b/timesheets_by_employee/report/report_timesheets.xml new file mode 100644 index 000000000..076f00ce0 --- /dev/null +++ b/timesheets_by_employee/report/report_timesheets.xml @@ -0,0 +1,74 @@ + + + + \ No newline at end of file diff --git a/timesheets_by_employee/report/timesheet_pdf.xml b/timesheets_by_employee/report/timesheet_pdf.xml new file mode 100644 index 000000000..9474b86c3 --- /dev/null +++ b/timesheets_by_employee/report/timesheet_pdf.xml @@ -0,0 +1,12 @@ + + + + diff --git a/timesheets_by_employee/static/description/banner.png b/timesheets_by_employee/static/description/banner.png new file mode 100644 index 000000000..c749b5f01 Binary files /dev/null and b/timesheets_by_employee/static/description/banner.png differ diff --git a/timesheets_by_employee/static/description/cybro_logo.png b/timesheets_by_employee/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/timesheets_by_employee/static/description/cybro_logo.png differ diff --git a/timesheets_by_employee/static/description/icon.png b/timesheets_by_employee/static/description/icon.png new file mode 100644 index 000000000..b4d838a0b Binary files /dev/null and b/timesheets_by_employee/static/description/icon.png differ diff --git a/timesheets_by_employee/static/description/index.html b/timesheets_by_employee/static/description/index.html new file mode 100644 index 000000000..47e25fd7e --- /dev/null +++ b/timesheets_by_employee/static/description/index.html @@ -0,0 +1,347 @@ +
+
+

+ Timesheet PDF Report of Employee +

+

+ Print timesheets of selected employees +

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

+ Overview +

+

+ This module by Cybrosys Technologies allows to print the timesheets of selected employee. + It will group all timesheet lines of selected employee in wizard by period. +

+

+ Configuration +

+

+ No additional configuration required. +

+
+
+ +
+
+

+ Features +

+

+ + Print the timesheets of selected employees. +

+

+ + Performs period wise grouping of timesheet lines. +

+
+
+ +
+
+

+ Screenshots +

+

+ + Timesheets -> Reporting -> Print Timesheets +

+
+ +
+

+ + Generate Timesheet Report Wizard With Dates. +

+
+ +
+

+ + PDF Report Of Employee Timesheet. +

+
+ +
+
+
+ + +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

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

+ + Trading + +

+

+ Easily procure and sell your products. +

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

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

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

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

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

+ + POS +

+

+ Easy configuring and convivial selling. +

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

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

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

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

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

+ + Education +

+

+ A Collaborative platform for educational management. +

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

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-1.png b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-1.png new file mode 100644 index 000000000..341895446 Binary files /dev/null and b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-1.png differ diff --git a/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-2.png b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-2.png new file mode 100644 index 000000000..34fa94122 Binary files /dev/null and b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-2.png differ diff --git a/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-3.png b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-3.png new file mode 100644 index 000000000..c1789a893 Binary files /dev/null and b/timesheets_by_employee/static/description/timesheet-by-employee-cybrosys-3.png differ diff --git a/timesheets_by_employee/wizard/__init__.py b/timesheets_by_employee/wizard/__init__.py new file mode 100644 index 000000000..453dd268c --- /dev/null +++ b/timesheets_by_employee/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# 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 . import timesheet_employee diff --git a/timesheets_by_employee/wizard/timesheet_employee.py b/timesheets_by_employee/wizard/timesheet_employee.py new file mode 100644 index 000000000..75f288577 --- /dev/null +++ b/timesheets_by_employee/wizard/timesheet_employee.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# 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 + + +class EmployeeTimesheet(models.TransientModel): + _name = 'timesheet.wizard' + + employee = fields.Many2one('res.users', string="Employee", required=True) + from_date = fields.Date(string="Starting Date") + to_date = fields.Date(string="Ending Date") + + def print_timesheet(self): + """Redirects to the report with the values obtained from the wizard + 'data['form']': name of employee and the date duration""" + + data = { + 'start_date': self.from_date, + 'end_date': self.to_date, + 'employee': self.employee.id + } + return self.env.ref('timesheets_by_employee.action_report_print_timesheets').report_action(self, data=data) + diff --git a/timesheets_by_employee/wizard/timesheet_wizard.xml b/timesheets_by_employee/wizard/timesheet_wizard.xml new file mode 100644 index 000000000..4bb89aa86 --- /dev/null +++ b/timesheets_by_employee/wizard/timesheet_wizard.xml @@ -0,0 +1,40 @@ + + + + + timesheet.wizard + timesheet.wizard + +
+ + + + + + + + +
+
+
+
+
+
+ + + timesheet.wizard + timesheet.wizard + ir.actions.act_window + form + form + + new + + +
+
+ + + diff --git a/website_product_attachments/README.rst b/website_product_attachments/README.rst new file mode 100644 index 000000000..906e08c3c --- /dev/null +++ b/website_product_attachments/README.rst @@ -0,0 +1,34 @@ +Website Product Attachments v11 +=============================== +This module allows customer to download documents that are attached to +the products from Website + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + +Configuration +============= + +No additional configurations needed + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Author +------ +Cybrosys Technologies + + +Credits +======= +Developer: v10.0 Fasluca @ cybrosys, Contact: odoo@cybrosys.com + v11.0 Kavya Raveendran @ cybrosys, Contact: odoo@cybrosys.com + diff --git a/website_product_attachments/__init__.py b/website_product_attachments/__init__.py new file mode 100644 index 000000000..153a9e31e --- /dev/null +++ b/website_product_attachments/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import controllers diff --git a/website_product_attachments/__manifest__.py b/website_product_attachments/__manifest__.py new file mode 100644 index 000000000..a8124e531 --- /dev/null +++ b/website_product_attachments/__manifest__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +{ + 'name': 'Product Attachments on Website', + 'version': '11.0.1.0.1', + 'summary': """This Module Allows Customer to Download Documents + That Are Attached to the Products From Website""", + 'description': 'This Module allows customer to download documents ' + 'that are attached to the products from website', + 'category': 'Website', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['document', 'website_sale'], + 'data': ['views/template.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_product_attachments/controllers/__init__.py b/website_product_attachments/controllers/__init__.py new file mode 100644 index 000000000..757b12a1f --- /dev/null +++ b/website_product_attachments/controllers/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import main diff --git a/website_product_attachments/controllers/main.py b/website_product_attachments/controllers/main.py new file mode 100644 index 000000000..d80bc17f5 --- /dev/null +++ b/website_product_attachments/controllers/main.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- + +import base64 +import io +from werkzeug.utils import redirect +from odoo import http +from odoo.http import request +from odoo.addons.website.controllers.main import QueryURL +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class WebsiteSale(WebsiteSale): + + @http.route(['/shop/product/'], type='http', auth="public", website=True) + def product(self, product, category='', search='', **kwargs): + product_context = dict(request.env.context, active_id=product.id) + ProductCategory = request.env['product.public.category'] + Rating = request.env['rating.rating'] + + if category: + category = ProductCategory.browse(int(category)).exists() + + attrib_list = request.httprequest.args.getlist('attrib') + attrib_values = [map(int, v.split("-")) for v in attrib_list if v] + attrib_set = set([v[1] for v in attrib_values]) + keep = QueryURL('/shop', category=category and category.id, search=search, attrib=attrib_list) + categs = ProductCategory.search([('parent_id', '=', False)]) + pricelist = request.website.get_current_pricelist() + from_currency = request.env.user.company_id.currency_id + to_currency = pricelist.currency_id + compute_currency = lambda price: from_currency.compute(price, to_currency) + # get the rating attached to a mail.message, and the rating stats of the product + ratings = Rating.search([('message_id', 'in', product.website_message_ids.ids)]) + rating_message_values = dict([(record.message_id.id, record.rating) for record in ratings]) + rating_product = product.rating_get_stats([('website_published', '=', True)]) + + if not product_context.get('pricelist'): + product_context['pricelist'] = pricelist.id + product = product.with_context(product_context) + + attachments = request.env['ir.attachment'].search( + [('res_model', '=', 'product.template'), + ('res_id', '=', product.id)], order='id') + + values = { + 'search': search, + 'category': category, + 'pricelist': pricelist, + 'attrib_values': attrib_values, + 'compute_currency': compute_currency, + 'attrib_set': attrib_set, + 'keep': keep, + 'categories': categs, + 'main_object': product, + 'product': product, + 'get_attribute_value_ids': self.get_attribute_value_ids, + 'rating_message_values': rating_message_values, + 'rating_product': rating_product, + 'attachments': attachments + } + return request.render("website_sale.product", values) + + @http.route(['/attachment/download'], type='http', auth='public') + def download_attachment(self, attachment_id): + # Check if this is a valid attachment id + attachment = request.env['ir.attachment'].sudo().search_read( + [('id', '=', int(attachment_id))], + ["name", "datas", "file_type", "res_model", "res_id", "type", "url"] + ) + if attachment: + attachment = attachment[0] + else: + return redirect('/shop') + + if attachment["type"] == "url": + if attachment["url"]: + return redirect(attachment["url"]) + else: + return request.not_found() + elif attachment["datas"]: + data = io.BytesIO(base64.standard_b64decode(attachment["datas"])) + return http.send_file(data, filename=attachment['name'], as_attachment=True) + else: + return request.not_found() diff --git a/website_product_attachments/doc/RELEASE_NOTES.md b/website_product_attachments/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..1db996250 --- /dev/null +++ b/website_product_attachments/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 27.05.2019 +#### Version 11.0.1.0.0 +##### ADD + +Initial Commit for website_product_attachments diff --git a/website_product_attachments/static/description/banner.jpg b/website_product_attachments/static/description/banner.jpg new file mode 100644 index 000000000..9a15692d6 Binary files /dev/null and b/website_product_attachments/static/description/banner.jpg differ diff --git a/website_product_attachments/static/description/cybro_logo.png b/website_product_attachments/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/website_product_attachments/static/description/cybro_logo.png differ diff --git a/website_product_attachments/static/description/icon.png b/website_product_attachments/static/description/icon.png new file mode 100644 index 000000000..3dc374499 Binary files /dev/null and b/website_product_attachments/static/description/icon.png differ diff --git a/website_product_attachments/static/description/index.html b/website_product_attachments/static/description/index.html new file mode 100644 index 000000000..622cc2ed2 --- /dev/null +++ b/website_product_attachments/static/description/index.html @@ -0,0 +1,340 @@ +
+
+

+ Product Attachments on Website +

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

+ Overview +

+

+ This Module allows customer to download + documents that are attached to the relevant products from website. +

+

+ Configuration +

+

+ No additional configuration required +

+
+
+ +
+
+

+ Features +

+

+ + Allows users to attach documents +

+

+ + Download attatchments from website +

+
+
+ +
+
+

+ Screenshots +

+

+ + Attach your documents like, product specification on product master. +

+
+ +
+

+ + Visitors of your e-commerce portal can download these attachments +

+
+ +
+ +
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

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

+ + Trading + +

+

+ Easily procure and sell your products. +

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

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

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

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

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

+ + POS +

+

+ Easy configuring and convivial selling. +

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

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

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

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

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

+ + Education +

+

+ A Collaborative platform for educational management. +

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

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + diff --git a/website_product_attachments/static/description/product.png b/website_product_attachments/static/description/product.png new file mode 100644 index 000000000..2dfff5ee5 Binary files /dev/null and b/website_product_attachments/static/description/product.png differ diff --git a/website_product_attachments/static/description/website-product-attachments-1.png b/website_product_attachments/static/description/website-product-attachments-1.png new file mode 100644 index 000000000..fc1b1b476 Binary files /dev/null and b/website_product_attachments/static/description/website-product-attachments-1.png differ diff --git a/website_product_attachments/static/description/website-product-attachments-2.png b/website_product_attachments/static/description/website-product-attachments-2.png new file mode 100644 index 000000000..2aa3bf3c1 Binary files /dev/null and b/website_product_attachments/static/description/website-product-attachments-2.png differ diff --git a/website_product_attachments/static/description/website.png b/website_product_attachments/static/description/website.png new file mode 100644 index 000000000..08800a0fe Binary files /dev/null and b/website_product_attachments/static/description/website.png differ diff --git a/website_product_attachments/views/template.xml b/website_product_attachments/views/template.xml new file mode 100644 index 000000000..6f8f4da3d --- /dev/null +++ b/website_product_attachments/views/template.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file