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
-
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 you will learn how to override Odoo methods. I will show you how to override Odoo Create, Write and Unlink method. Here the ...
-
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 post you will learned about binary fields in Odoo . You will also learned how to create and use binary fields or save images in Odoo...
-
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 ...
-
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 display the value of two columns in many2one fields in OpenErp. In Odoo many2one fields mean selection f...
-
Sublime Text is considered as a very popular text editor used for coding purposes. It is very easy to use and having so many features that m...
-
Today I am going to show you how to get active_id or current user login id. The question is why we need this id. The answer is that on the b...
-
Di post kali saya akan membahas bagaimana menghubungkan mysql ke python, langsung saja berikut caranya Pertama : Menyiapkan file lib mysql ...
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