Tags Used In OpenERP 7.0
In OpenERP 7.0. the form view of each object has been redesigned so that the object the user is working on resembles a real document. So, now when a user is creating an invoice, the document which appears on his screen actually looks like a hard copy invoice, a sales order will be similar to a sales order print out and so on. Likewise changes have been brought into the xml file. Html as well as css have been included for designing the forms . Some of the attributes and tags are mentioned below.
Header tag and status bar:
All the buttons appear on the left side of the form and the status bar should appear on the right side of the form. And this has to be in the header tag as shown below...
<header>
<button name="create_marklist" string="Create" type="object"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,sent,invoiced,done"
statusbar_colors='{"draft":"red","done":"blue"}'/>
</header>
some new attributes have been added into the status bar . statusbar_visible shows which all states to be visible to the user . To show the current status of the order statusbar_colors have been used . Here when the status turns to invoice_except the colour changes to red.
Sheet tag:
sheet tag gives your form a real document like appearance.
<sheet><sheet/>
Heading tags:
The <h1> to <h6> tags are used to define HTML headings.
<h1> defines the most important heading. <h6> defines the least important heading.
So if you need to provide headings you can use the corresponding heading tag.
<h1>
<label string="Heading " />
</h1>
Label tag:
Label tag is used to give labels to the corresponding fields. The for attribute tells which field should be provided with a label. An example is shown below
<label for="name"/>
<field name="name"/>
You can also use string attribute so that the label will change to what is given in the string.
<label String="Name"/>
<field name="name"/>
Placeholder attribute:
If you need a default string to appear in your text field you can provide an attribute placeholder as shown below.
<field name="note" placeholder="Terms and conditions..."/>
Editable attribute:
To edit from the tree view itself use the editable attribute in your tree view. This makes the edition simpler.
<tree string="Student Details" editable="bottom">
Help:
Initialy in the tree view there will not be any records . To direct the users to the next step a field called help is provided . You could provide the information using the paragraph tag <p></p> .
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new record.
</p><p>
provide your information here.
</p>
</field>
Color and fonts attributes:
You can also provide attributes in the tree string.
<tree string=”Sales order” fonts=”bold:message_unread==True”
colors="grey:state=='cancel';blue:state in (‘waiting_date’,'manual');red:state in ('invoice','shipping')">
<field name="order_number"/>
<field name="date_order"/>
<field name="partner_id"/>
<field name="user_id"/>
<field name="amount"/>
<field name="state"/>
</tree>
In the above example the font of the records appears bold and the colour of the records changes according to the states. If the state of the record is in manual state then the colour of the record in the tree view will be blue in colour as mentioned in the example.
html fields:
OpenERP 7.0 provides html fields too. An Example is shown below.
'memo': fields.html('Note Content'), (This is written in the python file)
<field name="memo" widget="html" class="oe_memo" editor_height="450px" />
By providing this u can bring the editor in to your form
Attachments:
To attach files from your computer you need to use the ‘ir.attachment’ model. The field should have a many2many relation to the ‘ir.attachment’ model. An example is shown below.
'attachment_ids': fields.many2many('ir.attachment', 'message','message_id', 'attachment_id', 'Attachments'),
<field name="attachment_ids" widget="many2many_binary"/>
Widgets available in OpenERP 7.0 widget="one2many_list" : Same as one2many in Openerp 7.0
widget="many2many_tags" : same as many2many in Openerp 7.0
widget="monetary": You will be able to see a dolar symbol after the value
widget="mail_followers" : To add Followers
widget="mail_thread" : Mail to groups
widget="statusbar" : shows the status bar
widget="progressbar" : Shows a progress bar
widget="html" : shows the html fields
widget="url" : Shows the url as a link
widget=”integer” : Only integer values will be saved in the fields
widget="many2many_kanban" :An add button appears and you will be able to see the tree view of the corresponding model.
Tags Used In OpenERP 7.0的更多相关文章
- JavaScript ,Css and Jquery In OpenERP 7.0
From: http://openerpbay.blogspot.jp/2013/02/javascript-css-and-jquery-in-openerp-70.html Hi fellows, ...
- 【转】CentOS 6.3 X64自动安装OpenERP 7.0脚本
原文地址:OpenERP 7.0安装与配置 #!/bin/bash -e # Modified script from Carlos E. Fonseca Zorrilla # . Add the t ...
- openerp 7.0邮件接收中文附件乱码问题解决办法
openerp 7.0邮件接收中文附件乱码问题解决办法: 修改文件\addons\mail\mail_thread.py #1064 line插入代码: h=email.Header.Header(n ...
- 在Ubuntu Server上源码安装OpenERP 8.0,并配置wsgi和nginx运行环境
原文: How to install OpenERP 8.0 Alpha on a fresh Debian / Ubuntu server. OpenERP的安装,可以有多种方式,通过添加源,到 h ...
- OpenERP 7.0 中文报表PDF乱码(WindowsXP)
OpenERP默认安装输出的PDF中文报表都是一些方块: 此问题可以通过oecn_base_fonts模块解决: 更多关于oecn_base_fonts的信息请参考: 1. OpenERPv7.0 中 ...
- Openerp 7.0 附件存储位置
我们知道对OpenERP中的每个内部对象(比如:业务伙伴,采购订单,销售订单,发货单,等等)我们都可以添加任意的附件,如图片,文档,视频等.那么这些附件在OpenERP内部是如何管理的呢? 默认情况下 ...
- 在Ubuntu 12 服务器上源码安装 OpenERP 8.0
原文:http://vivianyw.blog.163.com/blog/static/134547422201421112349489/ 1. 安装SSH: sudo apt-get install ...
- openerp 6.0.2库存业务
一.复式库存(Double-Entry Stock Management)和库存移动(Stock Move) OpenERP的库存管理采取了独特的复式库存(Double-Entry Stock Man ...
- openerp 7.0邮件多用户发送失败问题 解决方法
方法一(推荐): 修改代码/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_mail_server.py #425 line: #mail_ ...
随机推荐
- 【hash】BZOJ3751-[NOIP2014]解方程
[题目大意] 已知多项式方程:a0+a1*x+a2*x^2+...+an*x^n=0.求这个方程在[1,m]内的整数解(n和m均为正整数). [思路] *当年考场上怒打300+行高精度,然而没骗到多少 ...
- [CodeForces-440D]Berland Federalization
题目大意: 给你一棵树,你可以删掉一些边,使得分除去的子树中至少有一棵大小为k. 问最少删去多少边,以及删边的具体方案. 思路: 树形DP. f[i][j]表示以i为根,子树中去掉j个点最少要删边的数 ...
- [HihoCoder1169]猜单词
题目大意: 给你一个数列,问区间[l,r]内与k最接近的数与k的差是多少. 思路: 将数列中的数和询问的数先从小到大排序, 从小到大枚举每个数,如果是数列上的,就加到线段树中, 如果是询问中的,就在线 ...
- 【9.22校内测试】【可持久化并查集(主席树实现)】【DP】【点双联通分量/割点】
1 build1.1 Description从前有一个王国,里面有n 座城市,一开始两两不连通.现在国王将进行m 次命令,命令可能有两种,一种是在u 和v 之间修建道路,另一种是询问在第u 次命令执行 ...
- bzoj 3389: [Usaco2004 Dec]Cleaning Shifts安排值班 -- 贪心
3389: [Usaco2004 Dec]Cleaning Shifts安排值班 Time Limit: 1 Sec Memory Limit: 128 MB Description 一天有 ...
- MySQL之char、varchar和text的设计
最近有表结构设计中出现了varchar(10000)的设计引起了大家的讨论,我们下面就来分析分析. 首先我们先普及一下常识: 1.char(n)和varchar(n)中括号中n代表字符的个数,并不代表 ...
- SharePoint 2013 排错之"Code blocks are not allowed in this file"
今天,设置页面布局的自己定义母版页时,设置完了以后保存,然后预览报错,错误例如以下截图:删掉自己定义母版页的MasterPageFile属性,页面依旧报错:感觉甚是奇怪,由于有版本号控制,还原为最初的 ...
- AT070TN92 电源
第二版STM32 + RA8875 + AT070TN92 + 触摸屏 + USB + C++... http://www.amobbs.com/thread-5510972-1-1.html
- java多线程知识汇总(三)如何选择锁?如何加锁
1.锁,保证的是被锁的代码,一次执行完毕才能被其他线程执行,锁保证了一个线程执行过程中不被其他线程打断.以保证数据的准确性. 2.数据的读写过程,是有冲突的,当一个线程正在读数据,另一个线程正在写同一 ...
- CSRF攻击演示
CSRF就是伪装成用户做坏事! 它的手段可能是: 一张引发邪恶请求的图片: <img src="http://localhost/demoA.php?money=500" / ...