Before creating our first model in odoo, we need to know about model. A model is a python class
that represent business entity (fields) that are stored in PostgreSQL database. In odoo all business
entities are implemented as model or class. Model fields (class property) are defined as attributes or
column or fields in a database.
from openerp import models, fields
class AModel(models.Model):
_name = 'obe.core.department'
name = fields.Char(string="Department Name", required=True)
is_affiliated = fields.Boolean(string="Affiliated")
contact_no = fields.Char(string="Contact Number")
contact_no_two = fields.Char(string="Contact Number 2")
mobile = fields.Char(string="Mobile")
campus_id = fields.Many2one('obe.core.campus', string="Campus", required=True)
cc_detail = fields.Text(stirng="CC Detail")
dept_display_name = fields.Char(string="Display Name")
program_code_names = fields.Char(compute="def_program_code_names", string="Program Code")
department_code = fields.Char(string='Department Code')
In the above code we create a class named "AModel" and the name of model (tabel) is obe.core.model. In this table we have many fields or columns such as name, is_affiliated, contact_no etc. In simple words when we create fields in models, actually we create table and its fields or columns.
Our created model looks like the below screen shot.
Thursday, September 22, 2016
How to create models in odoo
Subscribe to:
Post Comments (Atom)
Paling Dilihat
-
Sore hari ini saya akan membagikan contoh aplikasi senderhana python berbasis database seperti yang saya beritahu di post sebelumnya, langsu...
-
Pengolahan Citra (Image Processing), citra memiliki arti sebagai gambar, pengolahan citra identik dengan penampilan gambar pada layar digita...
-
In this post you will learn how to hide or remove "Save" button from Odoo form view . Some time we want to create a form view to...
-
In this article I am going to teach you how to add or upload attachment or file (doc, excel, zip, jpg, png etc) from odoo website or web pag...
-
In this article you will learn how to override Odoo methods. I will show you how to override Odoo Create, Write and Unlink method. Here the ...
-
Today you will learn how to visible and invisible Odoo fields . Here I am trying to make a field visible and invisible in Odoo wizard when ...
-
In this article I will show you how to create a many2many field in odoo. I will also show you guys how to filter many2many field using domai...
-
Jasper Reports | Bolding text in variable expression is not a big issue in jasper reports using iReport. The question raise here that why we...
-
We are pleased to inform you that KICS (Al-Khawarizmi Institute of Computer Science) is organizing a seminar on Robotics on Oct 14, 2019 at ...
-
Okay, let's begin with installing laravel on windows, installing laravel on windows is quite easy actually. In this tutorial i will be u...
Labels
- .NET
- Adsense
- Alat Tes Air
- Android
- Android Box TV
- Android Nougat
- Android Oreo
- Android TV
- Android TV Box
- AngularJS
- API
- Aplikasi
- Arduino UNO R3
- arduino with java
- Arduino with JfreeChart and Java
- artisan command
- ASMX
- Assignments
- Audio
- BackEnd
- Bahasa C++
- Bahasa Pemrograman
- beginner
- Best DNS Server
- blade
- Blog
- Blogger
- Bluetooth 5
- bookstore Laravel 5
- bootstrap symfony
- Bundle
- C Plus Plus
- C Sharp
- C# temperature sensor LM35 Arduino
- C++
- Code Editor
- CodeIgniter
- codes
- Composer
- config
- configuracion laravel
- controller
- Cordova
- Create Read Update Delete Laravel 5
- Creating your first project in arduino
- CRUD
- CRUD Laravel 5
- crud operation laravel 5 mysql
- crud symfony
- Database
- debug
- Deep Learning
- dht11 arduino C#
- dht11 with java
- dht11 with jfreechart
- Django
- DNS
- Domain Name System
- Download
- Dropbox
- DropboxAPI
- Earbuds
- eloquent
- ERP
- error
- Event
- feature
- Framework
- Gamepad
- Getting Starting with Arduino
- Gmail
- Google Cardboard
- Google Daydream
- Google TV
- Gradle
- Grayscale
- Guest Post
- guide
- Harbolnas
- Headset
- Headset Bluetooth
- Headset VR
- Headset Wireless
- HiFi
- how to
- IIS
- Image Laravel 5
- Image Processing
- info
- installacion laravel
- Installing Arduino
- Internet
- Ionic
- IOS
- iReport
- Jaringan Komputer
- Jasper Report
- Jasper Soft
- JDK
- jfreechart arduino
- Komputer
- Kualitas Air
- Laravel
- Laravel 4
- laravel 4.2
- laravel 5
- laravel 5.2
- laravel 5.5
- Laravel Mix
- Laravel Tutorial
- Layanan
- LED Arduino
- Led Arduino with C# programming language
- Led Blinking
- Led Green
- led Red
- led Yellow
- Library Python
- Linux
- Machine Learning
- Mibox Update Oreo
- Microsoft Store
- migration
- Mobile
- model
- MongoDB
- Mysql
- NodeJS
- Object Detection
- object relational mapping
- Odoo
- Open Source
- Openerp
- OpenSource
- opinion
- ORM
- OSX
- PC
- Pemrograman
- Pen Tester
- Pengolahan Citra
- PHP
- Pillow
- Postgresql
- Purgecss
- PyMsql
- Python
- query
- query builder
- Qweb
- reference
- Resistors 150ohm
- restful laravel 5
- Review
- routes
- Routing
- Samarinda
- sample code
- Samsung
- schema builder
- SDK
- security
- Sejarah
- Send more than one value Arduino
- Send more values from Arduino
- sensor DHT11 in Arduino
- Sensor DHT11 with C# and Arduino
- sensor LM35 in Arduino using C#
- setup
- Smartphone
- Software
- solution
- Source Code
- SQLite
- SQLite3
- STMIK SPB Airlangga
- symfony
- syntax
- Tailwindcss
- TDS Meter
- Technology
- Teknologi
- temperature and humidity sensor DHT11 in Arduino with C#
- Temperature sensor DHT11 with jfreechart
- Temperature sensor LM35 in Arduino with C#
- temperature sensor LM35 with C#
- TensorFlow
- Terendam Air
- testing crud project laravel 5
- Text Editor
- TIK
- tips
- Tips&Triks
- Tkinter
- tool
- Traffic Light
- Traffic Light Arduino UNO R3
- Turn ON and Turn OFF Led in Arduino using C#
- Turn ON/OFF Arduino with C#
- Tutorial
- Twig
- Ubuntu Tips
- Ulasan
- Video
- view
- Virtual Reality
- Visual Studio
- VueJS
- Wamp Server
- Water Quality
- Water Tester
- WCF
- Web Design
- Web Services
- Website
- Windows
- Windows 10
- Windows Communication Foundation
- Windows Phone
- Windows Store
- WPF
- Xiaomi
- Youtube
- ZNT
- ZNT D08-L


0 comments
Post a Comment