Skip to content

Instantly share code, notes, and snippets.

View mdyusufalam's full-sized avatar

Md Yusuf Mia mdyusufalam

View GitHub Profile
1. Genrate KeyStore
2. Build App in Relaese Mode (cordova build android --release)
3. ZipAlign you unsigned releases apk
zipalign -v -p 4 <android-release-unsigned.apk file path> <android-release-unsigned-zipalign.apk file path>
4. apksigner sign --ks <keystorefilename.keystore path> --out <signed apk file path> <android-release-unsigned-zipalign.apk file path>
**Example
public object GetCreateAndShipOrder(string userName, string productSku)
{
// get product
var product = _merchelloContext.Services.ProductService.GetAll().FirstOrDefault(p => p.Sku == productSku);
// get customer
var customer = _merchelloContext.Services.CustomerService.GetByLoginName(userName);
// create customer with fake data if it does not exist already
if (customer == null)
/*
-- ======================================================================================
-- Author: Md Yusuf Alam
-- Create date: 13th May 2020
-- Description: https://docs.google.com/document/d/1GaIkxK5Dt3p7hGTMm7rZzSq1g656q78uhOaYrD9RBqk/edit Implement Quick Search
---------------------------------------------------------------------------------------
Ref# Modified By Modified date Descriptions
#1 [Developer Name] [Date] [Description]
----------------------------------------------------------------------------------------
*/
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@mdyusufalam
mdyusufalam / Enable Root Login to Ubuntu 18.4 Desktop
Last active January 10, 2021 11:04
Enable Root Login to Ubuntu 18.4 Desktop
Step 1:
sudo -i passwd root
--------------------------------------------------------------------
Step 2:
gedit /etc/gdm3/custom.conf
[Security]
AllowRoot = true
AllowRemoteRoot = true
------------------------------------------------------------------
@mdyusufalam
mdyusufalam / odoo vs configuration
Last active June 27, 2021 11:28
How configure Odoo Development with Visual Studio Code
1. Create Json file for debugging and put below line
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Odoo Debug",
@mdyusufalam
mdyusufalam / odoo-geo-fencing-dependency
Last active September 9, 2021 11:03
odoo geo fencing module
source /opt/odoo13/odoo-venv/bin/activate
pip install shapely
pip install geojson
pip install simplejson
SELECT * from hr_attendance
UPDATE hr_attendance set worked_hours = 0.0 where id=4
@mdyusufalam
mdyusufalam / debug.json
Last active October 1, 2021 17:57
debugJson
2021-09-30 11:41:14,283 9294 CRITICAL PG250621 odoo.addons.KY_GTE_REPAIR.models.KY_GTE_REPAIR: repair.order(1111,)
2021-09-30 11:41:14,284 9294 CRITICAL PG250621 odoo.addons.KY_GTE_REPAIR.models.KY_GTE_REPAIR: {
'id': 1111, 'state': 'draft', 'transfer_count': 2, 'name': 'RMA/2021/\t002811', 'tracking': 'serial', 'product_id': 96138, 'product_uom_category_id': 1, 'product_qty': 1, 'product_uom': 1, 'lot_id': 13068, 'partner_id': 98058, 'meter_reading': '3250', 'branch_id': 2, 'analytic_account_id': 181, 'analytic_tag_ids': [[6, False, []]], 'address_id': 98058, 'user_id': 274, 'company_id': 1, 'guarantee_limit': False, 'invoice_method': 'after_repair', 'partner_invoice_id': 98058, 'pricelist_id': 1, 'source_location_id': 18, 'picking_type': 7, 'tag_ids': [[6, False, []]], 'operations': [[4, 9519, False], [2, 9518, False]], 'amount_untaxed': 3554.9, 'amount_tax': 533.24, 'amount_total': 4088.14, 'total_qty_add': 5, 'total_qty_remove': 0, 'total_qty_remain': 5, 'fees_lines': [[4, 1323, False], [4, 1324, False]
1. Update package lists
sudo apt-get update
2. Install dependencies
sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less
3. Create odoo13 user in ubuntu
Create odoo13 user in ubuntu and assign home directory folder /opt/odoo13 (Skip this step if you already created the user odoo13 in ubuntu and start from step 4)
sudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13
4. Switch to user odoo13
sudo su odoo13
5. Install postgresql
** Multiply and update existing nested array doument numeric field in mongo
db.getCollection('Products_yus_mul').find({}).sort({_id:-1});
db.Products_yus_mul.update(
{}, // Filter to match the documents you want to update
[{ $set: { 'ProductSKUs.ProductPrices.Price01': { $multiply: [ 100, 1 ] } } }],
{ multi: true }
)