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
import xmlrpclib | |
from openerp.exceptions import except_orm | |
url = "http://localhost:8009" | |
db = "your_db_name" | |
user = "abc@gmail.com" | |
pwd = "1234" | |
url = 'http://localhost:8069' or '' | |
try: |
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"?> | |
<openerp> | |
<data> | |
<record id="your_scheduler_action_id" model="ir.cron"> | |
<field name="name">Name of your Scheduler Action</field> | |
<field name="user_id" ref="base.user_root"/> | |
<field name="interval_number">1</field> | |
<field name=" ">days</field> | |
<field name="numbercall">-1</field> | |
<field eval="False" name="doall"/> |
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 odoo_button_click(self): | |
print('****************odoo_button_click******************') | |
import os, zipfile | |
# function to convert binary data | |
def isBase64_decodestring(s): | |
try: | |
return base64.decodestring(s) | |
except Exception as e: | |
raise ValidationError('Error:', +str(e)) |
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 HREmployee(models.Model): | |
_inherit = 'hr.employee' | |
@api.multi | |
def load_employee_hierarchy(self): | |
domain = [] | |
if self._context.get('params', False): | |
params = self._context.get('params', False) | |
if params.get('menu_id', False): | |
raise ValidationError( |
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
<record id="employee_hierarchy_tree_view" model="ir.ui.view"> | |
<field name="name">hr.employee.hierarchy.tree</field> | |
<field name="model">hr.employee</field> | |
<field name="field_parent">child_ids</field> | |
<field eval="20" name="priority"/> | |
<field name="arch" type="xml"> | |
<tree string="Employees" toolbar="True"> | |
<field name="name"/> | |
<field name="company_id"/> | |
<field name="department_id"/> |
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 http | |
from openerp.http import request | |
from openerp.addons.web.controllers.main import Home | |
class Extension_Home(Home): | |
@http.route() | |
def web_login(self, redirect=None, **kw): | |
if 'login' in kw: | |
#your_logic_goes_here() | |
return super(Extension_Home, self).web_login() |
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 TestClass(http.Controller): | |
@http.route('/test/', type='http', auth='public') | |
def test_function(self, redirect=None, **kw): | |
if request.httprequest.method == 'POST': | |
return request.render('module_name.my_custom_form', { | |
'error': 'error message goes here', | |
'data': data, | |
}) | |
# To resolve this issue modify above controller with below one |
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="my_custom_form"> | |
<t t-call="web.login_layout"> | |
<form class="oe_signup_form" role="form" t-attf-action="/test/" method="post" onsubmit="this.action = this.action + location.hash"> | |
<div class="form-group field-login"> | |
<label for="name" class="control-label">Enter Name</label> | |
<input type="text" name="name" t-att-value="name" id="name" class="form-control" required="required" autofocus="autofocus"/> | |
</div> |
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 InheritedHome(Home): | |
@http.route() | |
def web_login(self, redirect=None, **kw): | |
if 'login' in kw: | |
#your_logic_goes_here() | |
return super(Extension_Home, self).web_login() | |
class MyCustomClass(http.Controller): | |
@http.route('/test/', type='http', auth='public', website=True) |