Browse Source

[ADD] Initial Commit

pull/81/head
SHEREEF PT 8 years ago
parent
commit
018d6f6ecd
  1. 29
      pos_magnify_image/README.rst
  2. 22
      pos_magnify_image/__init__.py
  3. 39
      pos_magnify_image/__openerp__.py
  4. BIN
      pos_magnify_image/static/description/banner.jpg
  5. BIN
      pos_magnify_image/static/description/cybro_logo.png
  6. BIN
      pos_magnify_image/static/description/icon.png
  7. 50
      pos_magnify_image/static/description/index.html
  8. BIN
      pos_magnify_image/static/description/magnify_image.png
  9. 18
      pos_magnify_image/static/src/css/product_image_magnify.css
  10. 58
      pos_magnify_image/static/src/js/pos_product_image.js
  11. 35
      pos_magnify_image/static/src/xml/pos_product_image.xml
  12. 11
      pos_magnify_image/views/pos_product_magnify_image.xml

29
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

22
pos_magnify_image/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

39
pos_magnify_image/__openerp__.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "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,
}

BIN
pos_magnify_image/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
pos_magnify_image/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
pos_magnify_image/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

50
pos_magnify_image/static/description/index.html

@ -0,0 +1,50 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Pos Product Magnify Image</h2>
<h3 class="oe_slogan">This module allow to magnify product image in pos.</h3>
<h4 class="oe_slogan" style="font-size: 23px;">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<div>
<h4><p>Features</p></h4>
<div>
<span style="color:green;"> &#9745; </span>+ icon on pos product image.<br/>
<span style="color:green;"> &#9745; </span>On clicking + icon, display pop up with magnified product image.<br/>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_demo oe_picture oe_screenshot">
<img src="magnify_image.png">
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
pos_magnify_image/static/description/magnify_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

18
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%;
}

58
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});
});

35
pos_magnify_image/static/src/xml/pos_product_image.xml

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<template id="template" xml:space="preserve">
<t t-extend="Product">
<t t-jquery="span.product" t-operation="append">
<div class="pos-product-magnify">
<a href="#">
<i class="fa fa-plus-square"/>
</a>
</div>
</t>
</t>
<t t-name="ProductZoomPopupWidget">
<div class="modal-dialog">
<div class="popup popup-barcode">
<p class="title"><t t-esc=" widget.options.title || 'Product' " /></p>
<p class="body">
<div class="product_large_image">
<img t-att-src='widget.image_url'/>
</div>
</p>
<div class="footer">
<div class="button cancel">
Close
</div>
</div>
</div>
</div>
</t>
</template>

11
pos_magnify_image/views/pos_product_magnify_image.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="pos_chatter" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/pos_magnify_image/static/src/css/product_image_magnify.css" />
<script type="text/javascript" src="/pos_magnify_image/static/src/js/pos_product_image.js"/>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save