diff --git a/pos_magnify_image/README.rst b/pos_magnify_image/README.rst new file mode 100644 index 000000000..b978ef8c6 --- /dev/null +++ b/pos_magnify_image/README.rst @@ -0,0 +1,29 @@ +============================ +Pos Product Magnify Image V9 +============================ + +This module allow to magnify product image in POS. + +Installation +============ + +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= + +Nothing to configure. + +Usage +===== + +* + icon on pos product image. +* On clicking on + icon, display pop up with magnified product image. + + +Credits +======= +Developer: Aswani pc @ cybrosys +Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in + + diff --git a/pos_magnify_image/__init__.py b/pos_magnify_image/__init__.py new file mode 100644 index 000000000..de1909c5e --- /dev/null +++ b/pos_magnify_image/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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 . +# +############################################################################## diff --git a/pos_magnify_image/__openerp__.py b/pos_magnify_image/__openerp__.py new file mode 100644 index 000000000..95cd9a16e --- /dev/null +++ b/pos_magnify_image/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# 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': "Pos Product Magnify Image", + 'version': '9.0.1.0.0', + 'summary': """Magnify Product Image in POS Screen""", + 'description': """Magnify Product Image In POS Screen.""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'website': "http://www.cybrosys.com", + 'category': 'Point of Sale', + 'depends': ['base', 'point_of_sale'], + 'data': ['views/pos_product_magnify_image.xml'], + 'qweb': ['static/src/xml/pos_product_image.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/pos_magnify_image/static/description/banner.jpg b/pos_magnify_image/static/description/banner.jpg new file mode 100644 index 000000000..9469b6f21 Binary files /dev/null and b/pos_magnify_image/static/description/banner.jpg differ diff --git a/pos_magnify_image/static/description/cybro_logo.png b/pos_magnify_image/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_magnify_image/static/description/cybro_logo.png differ diff --git a/pos_magnify_image/static/description/icon.png b/pos_magnify_image/static/description/icon.png new file mode 100644 index 000000000..4c518c439 Binary files /dev/null and b/pos_magnify_image/static/description/icon.png differ diff --git a/pos_magnify_image/static/description/index.html b/pos_magnify_image/static/description/index.html new file mode 100644 index 000000000..b0f1835be --- /dev/null +++ b/pos_magnify_image/static/description/index.html @@ -0,0 +1,50 @@ +
+
+

Pos Product Magnify Image

+

This module allow to magnify product image in pos.

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features

+
+ + icon on pos product image.
+ On clicking + icon, display pop up with magnified product image.
+
+
+
+
+ +
+
+
+ +
+
+
+ +
+

Need Any Help?

+ +
+ + diff --git a/pos_magnify_image/static/description/magnify_image.png b/pos_magnify_image/static/description/magnify_image.png new file mode 100644 index 000000000..a73a36b58 Binary files /dev/null and b/pos_magnify_image/static/description/magnify_image.png differ diff --git a/pos_magnify_image/static/src/css/product_image_magnify.css b/pos_magnify_image/static/src/css/product_image_magnify.css new file mode 100644 index 000000000..0ae160067 --- /dev/null +++ b/pos_magnify_image/static/src/css/product_image_magnify.css @@ -0,0 +1,18 @@ +.pos-product-magnify { + position: absolute; + bottom:auto; + top:0; + left: 2px; + line-height: 13px; + border-radius: 2px; + z-index:1000; +} +.product_large_image{ + margin: 0 auto; + width: 250px; + height:250px; +} +.product_large_image img{ + width: 100%; + height:100%; +} \ No newline at end of file diff --git a/pos_magnify_image/static/src/js/pos_product_image.js b/pos_magnify_image/static/src/js/pos_product_image.js new file mode 100644 index 000000000..89863fcd5 --- /dev/null +++ b/pos_magnify_image/static/src/js/pos_product_image.js @@ -0,0 +1,58 @@ +odoo.define('point_of_sale.pos_product_image_magnify', function (require) { +"use strict"; + +var screens = require('point_of_sale.screens'); +var gui = require('point_of_sale.gui'); +var core = require('web.core'); +var PopupWidget = require('point_of_sale.popups'); +var ProductListWidget = screens.ProductListWidget; +var QWeb = core.qweb; +var _t = core._t; + +ProductListWidget.include({ + renderElement: function() { + var el_str = QWeb.render(this.template, {widget: this}); + var el_node = document.createElement('div'); + el_node.innerHTML = el_str; + el_node = el_node.childNodes[1]; + + if(this.el && this.el.parentNode){ + this.el.parentNode.replaceChild(el_node,this.el); + } + this.el = el_node; + var list_container = el_node.querySelector('.product-list'); + for(var i = 0, len = this.product_list.length; i < len; i++){ + var product_node = this.render_product(this.product_list[i]); + product_node.addEventListener('click',this.click_product_handler); + product_node.querySelector('.pos-product-magnify').addEventListener('click',this.on_click_pos_product_magnify); + list_container.appendChild(product_node); + } + }, + get_product_image_large: function(product){ + return window.location.origin + '/web/image?model=product.product&field=image&id='+product.id; + }, + + on_click_pos_product_magnify: function (e) { + var self = this; + e.stopPropagation(); + var $target = $(e.currentTarget).parent(); + var product_id = $target.data('product-id'); + var product = this.pos.db.get_product_by_id(product_id); + var image_url = this.get_product_image_large(product); + this.gui.show_popup('product_image',{image_url:image_url, 'title': product.display_name}); + }, +}); + +var ProductZoomPopupWidget = PopupWidget.extend({ + template: 'ProductZoomPopupWidget', + show: function(options){ + options = options || {}; + var self = this; + this._super(options); + this.image_url = options.image_url + this.renderElement(); + } +}); +gui.define_popup({name:'product_image', widget: ProductZoomPopupWidget}); +}); + diff --git a/pos_magnify_image/static/src/xml/pos_product_image.xml b/pos_magnify_image/static/src/xml/pos_product_image.xml new file mode 100644 index 000000000..5ef943bc0 --- /dev/null +++ b/pos_magnify_image/static/src/xml/pos_product_image.xml @@ -0,0 +1,35 @@ + + + + + + + diff --git a/pos_magnify_image/views/pos_product_magnify_image.xml b/pos_magnify_image/views/pos_product_magnify_image.xml new file mode 100644 index 000000000..617379625 --- /dev/null +++ b/pos_magnify_image/views/pos_product_magnify_image.xml @@ -0,0 +1,11 @@ + + + +