From: http://openerpbay.blogspot.jp/2013/02/javascript-css-and-jquery-in-openerp-70.html

Hi fellows,

               Here i'm showing how can you use  JavaScript ,Css and Jquery In OpenERP 7.0.There is one cool feature added in openERP 7.0 in which you can use HTML tags inside openERP form view. This feature is not available in older version (Web 6.0 , 6.1). OpenERP already use HTML codes like <div> <H1> inside form view. But you can do much more than that you can use css and JavaScript inside form view code (OpenERP XML Code). Even more you can use JQuery also In Form View but JQuery is only work if you have old OpenERP 7 Web.In next few weeks i will show you how jquery also used in latest OpenERP 7.0 Web Code. 

                     Now, let's see how use this thing in form view. It is very if you have little knowledge of CSS and JavaScript. You can apply css as like you apply css in HTML code but only different is here you apply css in openerp form code. 

CSS

    In HTML we use css(inline) like this- Same like you can apply in OpenERP-

<p style="color:sienna;font-size:8pt;"></p> 
<field name="product_id" style="color:sienna;font-size:8pt;"/>

(This will apply css on that field but only if it in readonly form or it is in saved state.)

JavaScript

For JavaScript you can define script anyplace in code whare you can use HTML Tags.

<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0">
<sheet>
<script>
alert("Hi I'm JavaScript :P ");
</script>
<field name="image_medium" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Product Name"/>
</div>
<h1>
<field name="name"/>
</h1>
............
............

JQuery

For JQuery you need to apply your JQuery code inside script tag same as JavaScript. But this is not working in latest code.

<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0">
<sheet>
<script>
$(document).ready(function(){
$(".oe_edit_only").click(function(){
$(this).hide();
});
});
</script>
<field name="image_medium" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Product Name"/>
</div>
<h1>
<field name="name"/>
</h1>
............
............

Have a good day.

Save Paper, Save Trees.

JavaScript ,Css and Jquery In OpenERP 7.0的更多相关文章

  1. Javascript Fromdata 与jQuery 实现Ajax文件上传以及文件的删除

    前端HTML代码: <!DOCTYPE html> <html> <head> <title>ajax</title> <script ...

  2. Javascript Fromdata 与jQuery 实现Ajax文件上传

    <!DOCTYPE html> <html> <head> <title>ajax</title> <script type=&quo ...

  3. html css+div+jquery实现图片轮播

    一直想自己动手做一个图片轮播的控件,查查网上的资料大多引用已经做好的组件,其原理算法不是很清楚,于是自己用jquery写了一个.先看下效果图: 主要界面实现思路如下: 1.新建一个div宽度为100% ...

  4. 动态加载js和css的jquery plugin

    一个简单的动态加载js和css的jquery代码,用于在生成页面时通过js函数加载一些共通的js和css文件. //how to use the function below: //$.include ...

  5. jQuery plugin: Tablesorter 2.0

    http://mottie.github.io/tablesorter/docs/example-pager.htmlhttp://tablesorter.com/docs/example-pager ...

  6. css与jquery、图标字体

    *)还能这样选择 header #search input[type="text"] *)按钮常用颜色:#008cBA(字母大小写没有区别) *)清除浮动后,text-align没 ...

  7. JavaScript进阶内容——jQuery

    JavaScript进阶内容--jQuery 我们在前面的文章中已经掌握了JavaScript的全部内容,现在让我们了解一下JavaScript库 这篇文章主要是为了为大家大致讲解JavaScript ...

  8. CSS与JQuery的相关问题

    文字隐藏:p div里面的文字过长时隐藏文字: overflow:hidden; text-overflow:ellipsis; white-space:nowrap; --------------- ...

  9. 使用CSS和jQuery实现对话框

    因为项目中要显示一些对话框,但用alert显得太丑,后从网上找了一些插件,但有觉得不好用,因此自己试用CSS和jQuery写了一个对话框,代码如下: <!DOCTYPE html> < ...

随机推荐

  1. ms08-067漏洞的复现

    MS08-067漏洞重现 (1):MS08-067远程溢出漏洞描述 MS08-067漏洞的全称为“Windows Server服务RPC请求缓冲区溢出漏洞”,如果用户在受影响的系统上收到特制的 RPC ...

  2. MODI出现ORC RUNNING ERROR的解决方法

    stackflow都没个靠谱的说法,最后还是csdn上看到的.转一个备用.http://bbs.csdn.net/topics/390135443 由于直接执行Mircosoft Office Doc ...

  3. seebug的反爬虫技术初探

    1.通过request库无法直接爬取,返回521 >>> import requests >>> req = requests.get('https://www.s ...

  4. bozj 1449/2895: 球队预算 -- 费用流

    2895: 球队预算 Time Limit: 10 Sec  Memory Limit: 256 MB Description 在一个篮球联赛里,有n支球队,球队的支出是和他们的胜负场次有关系的,具体 ...

  5. 01-项目简介Springboot简介入门配置项目准备

    总体课程主要分为4个阶段课程: ------------------------课程介绍------------------------ 01-项目简介Springboot简介入门配置项目准备02-M ...

  6. iOS开发系列--通讯录、蓝牙、

    iOS开发过程中有时候难免会使用iOS内置的一些应用软件和服务,例如QQ通讯录.微信电话本会使用iOS的通讯录,一些第三方软件会在应用内发送短信等.今天将和大家一起学习如何使用系统应用.使用系统服务: ...

  7. TRF7970A IC Communication Interface

    General Introduction The communication interface to the reader can be configured in two ways: with a ...

  8. tomcat服务器重启后session可以继续使用

    原文:http://blog.csdn.net/e421083458/article/details/8651312 测试没有效果 配置server.xml文件,加入session保存操作 <C ...

  9. OpenERP实施记录(12):付款处理

    本文是<OpenERP实施记录>系列文章的一部分. 1. 在前面的文章中,采购订单确认时自动生成了供应商发票,可以在 会计 > 供应商列表 > 供应商发票 查询,状态为&quo ...

  10. 【jQuery】select动态追加的option选中

    var turnUpHidden = $("input[name='turnUpHidden']").val(); if(turnUpHidden != "") ...