Skip to content

Instantly share code, notes, and snippets.

module.PosWidget = module.PosWidget.extend({
build_widgets: function() {
var self = this;
this._super();
this.discount_card_widget = new module.PaymentScreenDiscountWidget(this, {});
this.discount_card_widget.replace($('.placeholder-PaymentScreenDiscountWidget'));
},
});
module.Order = Backbone.Model.extend({
addProduct: function(product, options){
options = options || {};
var attr = JSON.parse(JSON.stringify(product));
attr.pos = this.pos;
attr.order = this;
var line = new module.Orderline({}, {pos: this.pos, order: this, product: product});
console.log("add products................",product)
if(options.quantity !== undefined){
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<!-- Inherit to add fixed discount in template-->
<t t-extend="Orderline">
<t t-jquery="ul.info-list" t-operation="replace">
<ul class="info-list">
<t t-if="line.get_quantity_str() !== '1' || line.selected ">
@yk2kus
yk2kus / PosDB
Last active August 29, 2015 14:21
var PosDBSuper = module.PosDB
module.PosDB = module.PosDB.extend({
_partner_search_string: function(partner){
PosDBSuper.__super__._partner_search_string.call(this, partner);
},
})
def download_attachments(self, cr, uid, ids, context = None):
cache_buster = randint(10000000000,90000000000)
config_obj = self.pool.get('ir.config_parameter')
attachment_obj = self.pool.get('ir.attachment')
filestore_path = os.path.join(attachment_obj._filestore(cr, uid), '')
print "filestore path..............",filestore_path
attachment_dir = filestore_path + 'attachments'
#create directory and remove its content
if not os.path.exists(attachment_dir):
//Module 1:
function pos_payment_with_decimal(instance, module){ //module is instance.point_of_sale
var QWeb = instance.web.qweb;
var _t = instance.web._t;
module.PaymentScreenWidget = module.PaymentScreenWidget.extend({
events: function(){
return _.extend({},module.PaymentScreenWidget.prototype.events,{
"change .discount-card-select": "selectCard"
});
#!/bin/bash
################################################################################
# Script for Reverse proxy in Odoo
# Author: Yogesh Kushwaha, 25-December-2015
#-------------------------------------------------------------------------------
#
# This script will install ODOO Server on
# clean Ubuntu 14.04 Server
#-------------------------------------------------------------------------------
# USAGE:
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <[email protected]> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
@yk2kus
yk2kus / git_create_orphan.sh
Created March 27, 2018 16:49 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@yk2kus
yk2kus / AES_example.py
Created July 6, 2018 10:15 — forked from syedrakib/AES_example.py
an example of symmetric encryption in python using a single known secret key - utilizes AES from PyCrypto library
# Inspired from https://pythonprogramming.net/encryption-and-decryption-in-python-code-example-with-explanation/
# PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/
from Crypto.Cipher import AES
import base64, os
def generate_secret_key_for_AES_cipher():
# AES key length must be either 16, 24, or 32 bytes long
AES_key_length = 16 # use larger value in production
# generate a random secret key with the decided key length