Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

create new model description odoo

from odoo import models

class TestModel(models.Model):
    _name = "test.model"
    rder = "sequence"

    name = fields.Char('Plan Name', required=True, translate=True)
    number_of_months = fields.Integer('# Months', required=True)
    active = fields.Boolean('Active', default=True)
    sequence = fields.Integer('Sequence', default=10)

    _sql_constraints = [
        ('check_number_of_months', 'CHECK(number_of_months >= 0)', 'The number of month can't be negative.'),
    ]
Comment

PREVIOUS NEXT
Code Example
Python :: Add error message in django loginrequiredmixin 
Python :: join two deques 
Python :: # swap variables 
Python :: .format() multiple placeholders 
Python :: asdict that ignore sentinel 
Python :: r is.na pandas 
Python :: # sort the dictionary 
Python :: Doubleclick .py Prep Mac 
Python :: average values in a list python 
Python :: python bitcoin prices 
Python :: two lists with identical entries get order 
Python :: pyttsx3 Running a driver event loop 
Python :: how to sort list in python without sort function 
Python :: Code Example of Comparing None with None type 
Python :: add Elements to Python list Using extend() method 
Python :: en python quand on utilise = et== 
Python :: scikit learn lazy predict 
Python :: python count files fast 
Python :: which can be reversed , string or list? 
Python :: python is x string methods 
Python :: keyword only arguments python 
Python :: seasonal plot python 
Python :: python generate string of length 
Python :: Python NumPy dstack Function Syntax 
Python :: Python NumPy hsplit Function 
Python :: Python __truediv__ magic method 
Python :: else clause in for loop python 
Python :: WAP to input 3 no.s and print their sum. 
Python :: enumerate and looping backward 
Python :: Creating a Nested Dictionary 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =