Skip to content

Instantly share code, notes, and snippets.

View oriewancu's full-sized avatar
🇮🇩
Post web tutorials @ansori.web.id

Ansori, M oriewancu

🇮🇩
Post web tutorials @ansori.web.id
View GitHub Profile
@oriewancu
oriewancu / odoo12.service
Created May 6, 2020 03:26
Run odoo source as service in ubuntu 18.04 / 16.04
[Unit]
Description=Odoo12
Documentation=https://www.odoo.com
[Service]
Type=simple
User=ansori
ExecStart=/usr/bin/python3 /home/ansori/Projects/odoo12/odoo-bin -c /home/ansori/Projects/odoo12/odoo.conf
[Install]
@oriewancu
oriewancu / patient.py
Last active April 28, 2020 08:18
error render template
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def create(self, vals_list):
<?xml version="1.0" encoding='UTF-8'?>
<odoo>
<data noupdate="1">
<!-- sequence master data pasien -->
<record id="seq_rumahsakit_pasien" model="ir.sequence">
<field name="name">Sequence Pasien</field>
<field name="code">rumahsakit.pasien.sequence</field>
<field name="prefix">PN</field>
<field name="padding">4</field>
<field name="company_id" eval="False"/>
@oriewancu
oriewancu / pasien.py
Created April 28, 2020 02:00
sequence
from odoo import models, fields, api
class RumahsakitPasien(models.Model):
_name = 'rumahsakit.pasien'
_description = 'Master Pasien'
_rec_name = 'nama'
nama = fields.Char(string='Nama', required=True)
umur = fields.Integer(string='Umur')
keterangan = fields.Text(string='Catatan')
@oriewancu
oriewancu / ir.model.access.csv
Created April 27, 2020 09:52
hak akses model
id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_rumahsakit_pasien access.rumahsakit.pasien model_rumahsakit_pasien 1 1 1 1
@oriewancu
oriewancu / __init__.py
Created April 24, 2020 04:17
rumahsakit init
from . import pasien
@oriewancu
oriewancu / __manifest__.py
Last active April 24, 2020 04:50
rumahsakit manifest
{
'name': 'Rumah Sakit',
'version': '12.0.1.0.0',
'description': 'Modul untuk Manajemen Rumah Sakit',
'summary': 'Modul untuk Manajemen Rumah Sakit',
'author': 'Ansori',
'website': 'https://ansori.web.id',
'license': 'LGPL-3',
'category': 'Extra Tools',
'depends': [],
@oriewancu
oriewancu / pasien.xml
Last active April 24, 2020 05:17
rumahsakit view pasien
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- view tree: pasien -->
<record id="view_pasien_tree" model="ir.ui.view">
<field name="name">rumahsakit.pasien.tree</field>
<field name="model">rumahsakit.pasien</field>
<field name="arch" type="xml">
<tree string="Pasien">
<field name="nama" />
@oriewancu
oriewancu / pasien.py
Created April 24, 2020 03:11
app_rumah_sakit model pasien
from odoo import models, fields
class RumahsakitPasien(models.Model):
_name = 'rumahsakit.pasien'
_description = 'Master Pasien'
nama = fields.Char(string='Nama', required=True)
umur = fields.Integer(string='Umur')
keterangan = fields.Text(string='Catatan')
foto = fields.Binary(string='Foto', attachment=True)