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

时间: 2024-10-05 06:08:21

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,                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 yo

Openerp 7.0 附件存储位置

? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58         我们知道对OpenERP中的每个内部对象(比如:业务伙伴,采购订单,销售订单,发货单,等等)我们都可以添加任意的附件,如图片,文档,视频等.那么这些附

openerp 6.0.2库存业务

一.复式库存(Double-Entry Stock Management)和库存移动(Stock Move) OpenERP的库存管理采取了独特的复式库存(Double-Entry Stock Management).什么是复式库存?就是每一笔库存变动,同时记录库存减少和库存增加.例如卖了10辆自行车给客户,OpenERP会在你的库位(Location,这个概念后面再说)减去10辆自行车,再在客户库位(Customers Location)增加10辆自行车.因此,任何时候,OpenERP的所有库

OpenERP 7.0 导入 FAQ

Frequently Asked Questions Need to import data from an other application? In order to re-create relationships between different records, you should use the unique identifier from the original application and map it to the ID column in OpenERP. When y

DTCMS自定义标签,tags分割

DTcms.Web.UI\Label\article.cs /// <summary> /// 自定义:分割tags /// </summary> /// <param name="tags"></param> /// <returns></returns> protected string cut_tags(string tags) { string str=string.Empty; tags=tags.Rep

Odoo(OpenERP)配置文件详解

[options] ; addons模块的查找路径 addons_path = E:\GreenOdoo8.0\source\openerp\addons ; 管理员主控密码(用于创建.还原和备份数据库等操作) admin_passwd = admin ; 自动重载? auto_reload = None ; 用于导入导出的csv文件的默认分隔符 csv_internal_sep = , ; data目录, 用于存放session信息.附件 data_dir = data ; 数据库主机名 db

OpenERP 7 中的web配置文件解析-翻译 todo

ubuntu中OE的配置文件默认在目录: /etc/openerp 下面是你可以用来调整你OE的安装的配置项: 在我以前的一个OE7.0的帖子中,已经写了如何改变端口和其他默认配置来启动服务.你还可以通过 -c 命令来指定配置文件. ./server/openerp-server-c/path/to/openerp-server.conf这是作为一个引子,方便理解配置文件. 服务器启动常用配置项: # 管理员密码,用于创建,恢复和备份数据库 admin_passwd = admin # 默认分隔

SVN中trunk,branches,tags的使用明细--项目代码的管理

SVN在项目开发过程中有两种模式: 第一种:Subversion有一个很标准的目录结构,是这样的.比如项目是proj,svn地址为svn://proj/,那么标准的svn布局svn://proj/|+-trunk+-branches+-tags 这是一个标准的布局,trunk为主开发目录,branches为分支开发目录,tags为tag存档目录(不允许修改).但是具体这几个目录应该如何使用,svn并没有明确的规范,更多的还是用户自己的习惯. 对于这几个开发目录,一般的使用方法有两种.我更多的是从

OpenERP 源码变更后数据库升级

转自:http://vivianyw.blog.163.com/blog/static/13454742220142114422130/?latestBlog OpenERP代码升级后需要对数据进行升级,否则只是替换代买,会遇到很多意想不到的问题.这里记录一下升级操作的过程(这里是基于手动源码安装的换进进行说明: 1. 需要停止OpenERP的服务,视具体的安装时的启动脚本可能是: sudo /etc/init.d/openerp stop 或者 sudo /etc/init.d/openerp