This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openerp import models, fields | |
class AModel(models.Model): | |
_name = 'your.model.name' | |
name = fields.Char(string="Department Name", required=True) | |
is_test = fields.Boolean(string="Test Boolean Field") | |
amount = fields.Float(string="Amount") | |
Counter = fields.Integer(string="Counter") | |
many2one_id = fields.Many2one('your.model.name', string="Many2One", required=True) | |
cc_detail = fields.Text(stirng="CC Detail") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<odoo> | |
<data> | |
<record model="ir.actions.act_window" id="action_lo_student_info"> | |
<field name="name">Student Info</field> | |
<field name="res_model">lo.student.info</field> | |
<field name="view_mode">tree,form</field> | |
<!--<field name="view_ids" eval="[(5, 0, 0),(0, 0, {'view_mode': 'tree', 'view_id': ref('view_test_model_tree')}),(0, 0, {'view_mode': 'form', 'view_id': ref('view_test_model_form')})]"/>--> | |
<!--<field name="context">{}</field>--> | |
<!--<field name="domain">[()]</field>--> | |
<!--<field name="target">new</field>--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<odoo> | |
<data> | |
<record model="ir.ui.view" id="view_lo_student_info_form"> | |
<field name="name">lo.student.info.form</field> | |
<field name="model">lo.student.info</field> | |
<field name="type">form</field> | |
<field name="arch" type="xml"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Your_Model(models.Model): | |
_name='your.model' | |
def _get_employee(self): | |
domain =[('id', '=', -1)] | |
employee_list=[] | |
some_model = self.env['some.model'].search([('field','=','value')]) | |
for each in some_model: | |
employee_list.append(each.employee_id.id) | |
if employee_list: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.multi | |
def connection(self): | |
url = 'https://odoo 13 url goes here' | |
db = 'database name goes here' | |
username = 'admin' | |
password = 'admin' | |
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url)) | |
uid = common.authenticate(db, username, password, {}) | |
if uid: | |
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from openerp import http | |
from openerp.http import Controller, route, request | |
import json | |
import requests | |
class Google_Recaptcha(http.Controller): | |
@http.route('/google_recaptcha_in_odoo/', type='http', auth='public', website=True) | |
def google_recaptcha(self, redirect=None, **kw): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<openerp> | |
<data> | |
<template id="your_form_template" name="Login Form"> | |
<head> | |
<script src="https://www.google.com/recaptcha/api.js"></script> | |
</head> | |
<t t-call="web.login_layout"> | |
<form class="oe_signup_form" role="form" t-attf-action="/google_recaptcha_in_odoo/" method="post" onsubmit="this.action = this.action + location.hash"> | |
<div class="form-group field-login"> | |
<label for="first_name" class="control-label">Enter Name</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from openerp import http | |
from openerp.http import Controller, route, request | |
class graph_controller(http.Controller): | |
@http.route('/graph/<self_id>', auth='user', website=True) | |
def graph(self,self_id): | |
return http.request.render('test_workflow.graph_template', { | |
'x_axis':[1500,1600,1700,1750,1800,1850,1900,1950,1999,2050], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<openerp> | |
<data> | |
<template id="graph_template"> | |
<t t-call="website.layout"> | |
<head> | |
<title>Graph Web Controller Example</title> | |
</head> | |
<body> |