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
user_ids = fields.Many2many('res.users', string='Recipients', | |
domain=lambda self: [("groups_id", "=", | |
self.env.ref("base.group_erp_manager").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
<?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
from openerp import tools | |
class YourModelName(models.Model): | |
_name = 'your.model.name' | |
image = fields.Binary(string="Picture",required=True) | |
image_name = fields.Char("Picture Name") | |
@api.model | |
def create(self,values): |
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
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
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
<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> |