Skip to content

Instantly share code, notes, and snippets.

View mohammedshahil's full-sized avatar
:electron:

Mohammed Shahil mohammedshahil

:electron:
View GitHub Profile
@mohammedshahil
mohammedshahil / config.md
Last active April 27, 2025 08:26
Odoo Configuration Parameters

Config Parameters

Common options

CLI CommandsIn ConfigurationDescription
@mohammedshahil
mohammedshahil / zsh-fancify.sh
Created May 13, 2022 15:58 — forked from anthonyaxenov/zsh-fancify.sh
Installing zsh / oh-my-zsh / Powerlevel10k on Ubuntu 20.04
#!/bin/bash
# Based on:
# https://github.com/Powerlevel9k/powerlevel9k/wiki/Install-Instructions
# https://github.com/ohmyzsh/ohmyzsh
# https://powerline.readthedocs.io/en/latest/installation/linux.html#fonts-installation
# https://gist.github.com/dogrocker/1efb8fd9427779c827058f873b94df95
# https://linuxhint.com/install_zsh_shell_ubuntu_1804/
echo "*********************************************"
echo " zsh fancifier"
@mohammedshahil
mohammedshahil / odoo_ubuntu_20.04.md
Last active September 24, 2022 04:41
Install Odoo 13, 14, 15 on Ubuntu 20.04

Update System

sudo apt-get update
sudo apt-get upgrade

Secure Server

sudo apt-get install openssh-server fail2ban
def generate_report(self):
try:
vals = json.loads(self.filters)
except:
raise UserError(_("Please select filters for the report."))
today = fields.Date.today()
if self.report_date == 'previous':
date = fields.Date.subtract(today, days=1)
vals['start_date'] = vals['end_date'] = fields.Date.to_string(date)
elif self.report_date == 'week':
@mohammedshahil
mohammedshahil / list_view_from_scratch.js
Created October 6, 2021 17:47 — forked from ged-odoo/list_view_from_scratch.js
toy list view made in owl and the new odoo js framework
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { KeepLast } from "@web/core/utils/concurrency";
import { useService } from "@web/core/utils/hooks";
import { XMLParser } from "@web/core/utils/xml";
import { Model, useModel } from "@web/views/helpers/model";
import { ViewLayout } from "@web/views/view_layout";
// -----------------------------------------------------------------------------
@mohammedshahil
mohammedshahil / pdf_template.py
Created September 29, 2021 16:42
PDF Template
def generate_report(self):
report = self.env[self.report_id.model].create(json.loads(self.filters))
report.get_values()
pdf_data = report.print_pdf()
domain = [('model', '=', 'ir.actions.report'), ('res_id', '=', self.report_id.id)]
model_data = self.env['ir.model.data'].search(domain, limit=1)
xml_id = "%s.%s" % (model_data.module, model_data.name)
report_template_id = self.env.ref(
'averigo_transaction_report.report_transaction_list_report').render_qweb_pdf(report.id, data = pdf_data['data'])
data_record = base64.b64encode(report_template_id[0])