Skip to content

Instantly share code, notes, and snippets.

View sambatlim's full-sized avatar
🧮
CODING

Sambat Lim sambatlim

🧮
CODING
View GitHub Profile
@sambatlim
sambatlim / student_view.xml
Created September 17, 2019 02:55
My student_view.xml file
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="student_menu_action" model="ir.actions.act_window">
<field name="name">Students</field>
<field name="res_model">student.student</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="help" type="html">
# -*- coding: utf-8 -*-
{
"name": "assettracking",
"summary": """
Asset tracking includes the functionality of inventory module""",
"description": """
Asset tracking system was used in in-house production for NECTEC project
""",
"author": "NECTEC",
"website": "https://www.nectec.or.th/en/",
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="student_menu_action" model="ir.actions.act_window">
<field name="name">Students</field>
<field name="res_model">student.student</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="help" type="html">
@sambatlim
sambatlim / Command to create module of odoo12 for window10.txt
Last active October 10, 2019 02:14
Command to create module of odoo12 for window10
Run your CMD as administration and copy and paste the command below and hit enter.
"C:\Program Files (x86)\Odoo 12.0\python\python.exe" "C:\Program Files (x86)\Odoo 12.0\server\odoo-bin" scaffold manageasset "C:\Users\User\Desktop\custom_addons"
<*==============================================*>
Command explanation:
"C:\Program Files (x86)\Odoo 12.0\python\python.exe" "C:\Program Files (x86)\Odoo 12.0\server\odoo-bin": this command is the respository of your odoo12 instalation -It used to be odoo-bin.
"scaffold": will create the module.
Error message:
None
Traceback (most recent call last):
File "C:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 1039, in get
value = self._data[key][field][record._ids[0]]
KeyError: 2
During handling of the above exception, another exception occurred:
@sambatlim
sambatlim / odoomodule.py
Last active October 28, 2019 02:51
script to generate odoo module command. [LIVE DEMO](https://repl.it/@sambatlim/InfantileWoodenAmoebas)
print("Please, give your module name")
x = input()
print("insert 1 to use default directory, 2 to use your custom addon directory")
y = input()
if int(y) == 1:
print("Command to create the module. * Copy and paste in cmd - run cmd as administration")
directory = r"C:\Users\User\Desktop\custom_addons"
command = "\"C:\Program Files (x86)\Odoo 12.0\python\python.exe\""+" \"C:\Program Files (x86)\Odoo 12.0\server\odoo-bin\""+ " scaffold " + x
print(command + f' "{directory}"')
else:
var utility = ['pink bag','pink book','pink pen','pink shirt','pink shoe'];
var shop = [{'shopname':'aa shop','sell':'pink bag','price':30000,'distance':2},{'shopname':'bb shop','sell':'pink shirt','price':10000,'distance':3},{'shopname':'cc shop','sell':'pink shoe','price':15000,'distance':1},{'shopname':'dd shop','sell':'pink skirt','price':25000,'distance':0.5}]
var how ={'grab':5000,'own motor':2000};
var moneyihave = 50000;
var findperfectgift = async(moneyihave)=>{
findshop(moneyihave,(whatshop,whattobuy,moneyileft)=>{
findhow(moneyileft,(moneytopay,howigo)=>{
@sambatlim
sambatlim / virtualenv.md
Last active June 25, 2023 16:53
This is the snippet command to create virtual environment and install the requirement.txt in python [For windows].

*Requirement

If you never install virtual environment before, you need to have virtual env install.

py -m pip install --user virtualenv

Get started

$ cd <# your project folder name #>
$ py -m venv env &lt;# (it will create the new folder in your repository called env). #&gt;
@sambatlim
sambatlim / closure.js
Created August 27, 2020 09:52
simple javascript closure code
/// closure in javascript
// using parentheses
{
const value = 0
}
//console.log(value);