diff --git a/website_upload_files/README.rst b/website_upload_files/README.rst new file mode 100644 index 000000000..5ddd765c3 --- /dev/null +++ b/website_upload_files/README.rst @@ -0,0 +1,38 @@ +Website File Upload +=================== +This Module allows customer to upload documents +for the sale order + + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: Sruthi M V15@cybrosys, Contact: odoo@cybrosys.com +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/website_upload_files/__init__.py b/website_upload_files/__init__.py new file mode 100644 index 000000000..365a9321c --- /dev/null +++ b/website_upload_files/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models +from . import controller diff --git a/website_upload_files/__manifest__.py b/website_upload_files/__manifest__.py new file mode 100644 index 000000000..116f32323 --- /dev/null +++ b/website_upload_files/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Website File Upload', + 'version': '15.0.1.0.0', + 'summary': 'Option To Upload Files In Website', + 'description': 'Option To Upload Files In Website', + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'license': 'LGPL-3', + 'depends': [ + 'website_sale', + 'sale_management', + ], + 'data': [ + 'views/website_sale_templates.xml', + 'views/sale_order_views.xml', + ], + 'images': ['static/description/banner.png'], + 'assets': { + 'web.assets_frontend': [ + 'website_upload_files/static/src/js/attachment.js', + ], + }, + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/website_upload_files/controller/__init__.py b/website_upload_files/controller/__init__.py new file mode 100644 index 000000000..b2a2bc71e --- /dev/null +++ b/website_upload_files/controller/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import main diff --git a/website_upload_files/controller/main.py b/website_upload_files/controller/main.py new file mode 100644 index 000000000..1d7d9c0a2 --- /dev/null +++ b/website_upload_files/controller/main.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo.addons.website_sale.controllers.main import WebsiteSale +from odoo.http import request +import base64 +from odoo import fields, http, SUPERUSER_ID, tools, _ + + +class WebsiteSaleFileUpload(WebsiteSale): + + @http.route(['/shop/add_attachment'], type='http', auth="public", website=True, + sitemap=False) + def add_attachments(self, **post): + order = request.website.sale_get_order() + if post.get('attachment', False): + attachment_ids = request.env['ir.attachment'] + name = post.get('attachment').filename + file = post.get('attachment') + attachment = file.read() + attachment_ids.sudo().create({ + 'name': name, + 'res_name': name, + 'type': 'binary', + 'res_model': 'sale.order', + 'res_id': order.id, + 'datas': base64.b64encode(attachment), + }) diff --git a/website_upload_files/doc/changelog.md b/website_upload_files/doc/changelog.md new file mode 100644 index 000000000..3cf73a1dd --- /dev/null +++ b/website_upload_files/doc/changelog.md @@ -0,0 +1,10 @@ +## Module + +#### 22.06.2022 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit + + + + diff --git a/website_upload_files/models/__init__.py b/website_upload_files/models/__init__.py new file mode 100644 index 000000000..02660ac75 --- /dev/null +++ b/website_upload_files/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import sale_order \ No newline at end of file diff --git a/website_upload_files/models/sale_order.py b/website_upload_files/models/sale_order.py new file mode 100644 index 000000000..866f12894 --- /dev/null +++ b/website_upload_files/models/sale_order.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, fields, models, _ + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + attachment_count = fields.Integer('Attachment Count', + compute='_compute_attachment_count') + + def _compute_attachment_count(self): + for rec in self: + attachments = self.env['ir.attachment'].search_count( + [('res_model', '=', 'sale.order'), ('res_id', '=', rec.id)]) + rec.attachment_count = attachments + + def action_show_attachments(self): + return { + 'name': _('Attachments'), + 'view_mode': 'kanban,form', + 'res_model': 'ir.attachment', + 'type': 'ir.actions.act_window', + 'domain': [('res_model', '=', 'sale.order'), ('res_id', '=', self.id)] + } diff --git a/website_upload_files/static/description/assets/icons/check.png b/website_upload_files/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_upload_files/static/description/assets/icons/check.png differ diff --git a/website_upload_files/static/description/assets/icons/chevron.png b/website_upload_files/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/chevron.png differ diff --git a/website_upload_files/static/description/assets/icons/cogs.png b/website_upload_files/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/cogs.png differ diff --git a/website_upload_files/static/description/assets/icons/consultation.png b/website_upload_files/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_upload_files/static/description/assets/icons/consultation.png differ diff --git a/website_upload_files/static/description/assets/icons/ecom-black.png b/website_upload_files/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/ecom-black.png differ diff --git a/website_upload_files/static/description/assets/icons/education-black.png b/website_upload_files/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_upload_files/static/description/assets/icons/education-black.png differ diff --git a/website_upload_files/static/description/assets/icons/hotel-black.png b/website_upload_files/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_upload_files/static/description/assets/icons/hotel-black.png differ diff --git a/website_upload_files/static/description/assets/icons/license.png b/website_upload_files/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_upload_files/static/description/assets/icons/license.png differ diff --git a/website_upload_files/static/description/assets/icons/lifebuoy.png b/website_upload_files/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_upload_files/static/description/assets/icons/lifebuoy.png differ diff --git a/website_upload_files/static/description/assets/icons/logo.png b/website_upload_files/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_upload_files/static/description/assets/icons/logo.png differ diff --git a/website_upload_files/static/description/assets/icons/manufacturing-black.png b/website_upload_files/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_upload_files/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_upload_files/static/description/assets/icons/pos-black.png b/website_upload_files/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/pos-black.png differ diff --git a/website_upload_files/static/description/assets/icons/puzzle.png b/website_upload_files/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/puzzle.png differ diff --git a/website_upload_files/static/description/assets/icons/restaurant-black.png b/website_upload_files/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/restaurant-black.png differ diff --git a/website_upload_files/static/description/assets/icons/service-black.png b/website_upload_files/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_upload_files/static/description/assets/icons/service-black.png differ diff --git a/website_upload_files/static/description/assets/icons/trading-black.png b/website_upload_files/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_upload_files/static/description/assets/icons/trading-black.png differ diff --git a/website_upload_files/static/description/assets/icons/training.png b/website_upload_files/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_upload_files/static/description/assets/icons/training.png differ diff --git a/website_upload_files/static/description/assets/icons/update.png b/website_upload_files/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_upload_files/static/description/assets/icons/update.png differ diff --git a/website_upload_files/static/description/assets/icons/user.png b/website_upload_files/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_upload_files/static/description/assets/icons/user.png differ diff --git a/website_upload_files/static/description/assets/icons/wrench.png b/website_upload_files/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_upload_files/static/description/assets/icons/wrench.png differ diff --git a/website_upload_files/static/description/assets/screenshots/hero.png b/website_upload_files/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..4218b3593 Binary files /dev/null and b/website_upload_files/static/description/assets/screenshots/hero.png differ diff --git a/website_upload_files/static/description/assets/screenshots/screenshot1.png b/website_upload_files/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..8831384b7 Binary files /dev/null and b/website_upload_files/static/description/assets/screenshots/screenshot1.png differ diff --git a/website_upload_files/static/description/assets/screenshots/screenshot2.png b/website_upload_files/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..7a0c3ecb2 Binary files /dev/null and b/website_upload_files/static/description/assets/screenshots/screenshot2.png differ diff --git a/website_upload_files/static/description/assets/screenshots/screenshot3.png b/website_upload_files/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..032aa2c20 Binary files /dev/null and b/website_upload_files/static/description/assets/screenshots/screenshot3.png differ diff --git a/website_upload_files/static/description/banner.png b/website_upload_files/static/description/banner.png new file mode 100644 index 000000000..18295da1c Binary files /dev/null and b/website_upload_files/static/description/banner.png differ diff --git a/website_upload_files/static/description/icon.png b/website_upload_files/static/description/icon.png new file mode 100644 index 000000000..b51a89fba Binary files /dev/null and b/website_upload_files/static/description/icon.png differ diff --git a/website_upload_files/static/description/index.html b/website_upload_files/static/description/index.html new file mode 100644 index 000000000..8276e4220 --- /dev/null +++ b/website_upload_files/static/description/index.html @@ -0,0 +1,454 @@ + +
+
+
+

+ Website File Upload

+

+ Option To Upload Files In Website +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module allows to upload files from the payment page. + And also we can see the smart button on sale order for seeing uploaded files.

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Attach Documents

+

+ Allow users to attach documents for sale order

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

+ Screenshots +

+
+
+

+ Attach documents from website

+

+ User can click add attachment button then will appear a wizard. From the wizard user can upload file. +

+ +
+ +
+

+ Attachments smart button

+

+ A smart button is on sale order for seeing all related attachments of the sale order +

+ +
+ +
+

+ Press the smart button

+

+ When clicking the smart button user can see all the attachments related to the sale order +

+ +
+ +
+ + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/website_upload_files/static/src/js/attachment.js b/website_upload_files/static/src/js/attachment.js new file mode 100644 index 000000000..aa6258016 --- /dev/null +++ b/website_upload_files/static/src/js/attachment.js @@ -0,0 +1,7 @@ +const btn = document.getElementById('add_attachment'); +if(btn){ + btn.addEventListener('click', () => { + console.log("success") + $('#add_sale_attachment').modal('hide'); + }); +} diff --git a/website_upload_files/views/sale_order_views.xml b/website_upload_files/views/sale_order_views.xml new file mode 100644 index 000000000..2437aeb13 --- /dev/null +++ b/website_upload_files/views/sale_order_views.xml @@ -0,0 +1,15 @@ + + + + sale.order.attachment + sale.order + + +
+ +
+
+
+
diff --git a/website_upload_files/views/website_sale_templates.xml b/website_upload_files/views/website_sale_templates.xml new file mode 100644 index 000000000..f191428cc --- /dev/null +++ b/website_upload_files/views/website_sale_templates.xml @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file