This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 "> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PosDBSuper = module.PosDB | |
module.PosDB = module.PosDB.extend({ | |
_partner_search_string: function(partner){ | |
PosDBSuper.__super__._partner_search_string.call(this, partner); | |
}, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer