没有合适的资源?快使用搜索试试~ 我知道了~
首页odoo web 开发
资源详情
资源评论
资源推荐
1 / 141
OpenERP Web Training
OpenERP Web Training ....................................................................................... 1
一、Introduction .......................................................................................... 3
Reminder about OpenERP Structure .................................................................... 3
About this Guide ................................................................................... 4
二、JavaScript Basics ...................................................................................... 5
Javascript 基础知识 ........................................................................................ 5
Preamble 前言 ....................................................................................... 5
What is a Web Application ? ................................................................. 5
A Note about JavaScript 关于 Javascript 的注记................................................ 6
Command Line Interpreter ........................................................................... 7
Basic Data Types 基本数据类型 ...................................................................... 8
Numbers 数字 ................................................................................ 8
Booleans 布尔值 ............................................................................. 9
Strings 字符串 .............................................................................. 9
Null 空值 .................................................................................. 10
Undefined 未定义 ........................................................................... 10
Implicit Type Conversions 类型转换 ................................................................. 10
Control Structures ................................................................................ 12
Functions 函数 .................................................................................... 13
Variables and Scopes 变量和作用范围 ................................................................ 14
Arrays 数组 ....................................................................................... 17
Objects ........................................................................................... 18
三、JavaScript Libraries JavaScrip 库 ..................................................................... 21
A First JavaScript Application 第一个 JavaScript 程序 ............................................... 21
Download and Launch the Start Application .................................................. 21
Architecture of the Application ............................................................ 22
The Module Pattern ......................................................................... 24
Debugging Tools 调试工具 ................................................................... 27
Underscore.js ..................................................................................... 28
HTML Manipulations with jQuery .................................................................... 31
The DOM .................................................................................... 31
jQuery Selectors jQuery 选择器 ............................................................. 33
jQuery Events JQuery 事件 .................................................................. 35
DOM Modifications with jQuery 用 JQuery 修改 DOM。 .......................................... 36
Exercise 练习 .............................................................................. 37
HTTP Requests with jQuery 使用 JQuery 的 HTTP 请求 .................................................. 38
The $.ajax() method $.ajax() 方法 ................................................... 40
Promises and Deferreds 承诺和递延 .......................................................... 42
Composing Deferreds 复合 Deferreds ........................................................ 45
Exercises 练习 ............................................................................ 50
四、OpenERP Web Framework ................................................................................. 52
2 / 141
A Simple Module to Test the Web Framework .......................................................... 53
OpenERP JavaScript Module ......................................................................... 57
Classes ........................................................................................... 59
Widgets Basics .................................................................................... 62
Your First Widget .......................................................................... 63
Display Content ............................................................................ 64
Widget Parents and Children ................................................................ 68
Destroying Widgets 销毁部件 ................................................................ 70
The QWeb Template Engine .......................................................................... 70
Using QWeb inside a Widget 在部件内使用 QWeb ................................................ 72
Widget Events and Properties 部件事件和属性 ........................................................ 82
Events 事件 ................................................................................ 82
Properties 属性 ............................................................................ 85
Exercise 练习 .............................................................................. 86
Widget Helpers 部件辅助工具 ....................................................................... 90
Widget 's jQuery Selector 部件的 jQeruy 选择器 .............................................. 90
Easier DOM Events Binding 简易 DOM 事件绑定 ................................................ 92
Development Guidelines 开发指南 ............................................................ 93
Modify Existent Widgets and Classes ................................................................ 95
Translations ...................................................................................... 97
Communication with the OpenERP Server .............................................................. 98
Contacting Models 与 Models 交互 ............................................................ 99
CompoundContext 复合上下文 ................................................................ 103
Queries 查询 .............................................................................. 105
Exercises 练习 ................................................................................... 107
五、OpenERP Web Components ............................................................................... 114
The Action Manager ............................................................................... 114
Using the Action Manager .................................................................. 115
使用
Action Manager
....................................................................... 115
Client Actions ................................................................................... 119
客户端 actions .................................................................................... 119
Architecture of the Views ........................................................................ 120
视图架构 ......................................................................................... 120
The View Manager .......................................................................... 120
视图管理器 ................................................................................ 121
The Views ................................................................................. 122
视图: .................................................................................... 122
The Form View Fields ............................................................................. 122
表单视图字段 ..................................................................................... 122
Creating a New Type of Field .............................................................. 127
创建一个新的字段类型 ...................................................................... 127
The Form View Custom Widgets ..................................................................... 135
表单视图自定义 Widgets ............................................................................ 135
3 / 141
一、Introduction
Reminder about OpenERP Structure
OpenERP 架构备忘
OpenERP contains the following parts:
OpenERP 包括下面的流程图部分。
The OpenERP server contains the server-side framework and handles
requests coming from clients.
OpenERP 服务包含服务端的框架,用来处理来自客户端的请求。
The PostgreSQL database contains our data.
PostgreSQL 数据库存储数据。
The modules implement the business logic.
Modules(模块)实现了业务逻辑。
The client web application communicates with the server and displays a
graphical user interface.
客户端应用程序与服务通信,并向用户显示图形界面。
This guide is all about web applications development and the OpenERP's web
client.
这个指南是关于 web 应用程序开发和 OpenERP 的 web 客户端。
4 / 141
About this Guide
This guide is a training material to teach OpenERP integrators how to create
web modules for OpenERP. The covered subjects are the following:
这个指南是一份培训资料,用来培训 OpenERP 的集成人员如何创建 web 模块,
覆盖的子项如下:
Javascript basics and good practices
Javascript 基础以及良好实践。
Basics of jQuery and Underscore (Javascript libraries used in
OpenERP's web client)
JQuery ,Underscore 基础(在 OpenERP 的 web 客户端内使用的
javascrip 库)
OpenERP's Javascript and web applications framework
OpenERP 的 javascript 和 web 应用程序框架。
Extension points for OpenERP's web client
OpenERP web 客户端的其他扩展点。
This guide assumes the reader followed the technical training about OpenERP
modules creation provided by OpenERP SA or have a good knowledge of
Python modules development. This guide also assume the reader is
experienced in object-oriented programming and has basic knowledge of at
least one programming language whose syntax is based on C (C++, Java,
C#,...). It may also refer to the Bazaar version control system. Finally, it is
necessary to have a minimal knowledge of HTML and CSS.
这个指南假设读者已经参与了 OpenERP SA 提供的模块创建技术培训,或
者在 Python 模块开发方面有良好的知识经验。也假设读者有面向对象编程经验,
至少有一门 C 系列语言(C++,java,C#)的编程经验。引用了 Bazaar 版本控
制系统。最后,需要有 HTML 和 CSS 的最基本的基础知识。
All provided examples assume you are developing under a Linux operating
system, most specifically Ubuntu or Debian. If you are using Windows, we
recommend you to get a virtual machine with Ubuntu. The
website http://virtualboxes.org/ provides pre-installed virtual machines images
for a lot of Linux distributions for free. They only require to install Virtual Box
which is also free.
提供的所有样例,是基于假设你具备在 Linux 下的开发经验,更具体的是在
Ubuntu 或 Debian 下的开发经验。如果你使用 Windows,我们建议你下载一个
5 / 141
Ubuntu 的虚拟机。站点 http://virtualboxes.org/ 免费提供许多安装好 Linux 各种
发行版的虚拟机镜像,使用这些镜像,需要安装免费虚拟机程序 Virtual Box。
二、JavaScript Basics
Javascript 基础知识
Preamble 前言
What is a Web Application ?
web 应用程序是什么?
A web application is simply an application that is delivered and used through a
web browser, but the term has recently taken a more specific meaning.
Web 应用程序是一个通过 Web 浏览器交付使用的简单应用程序,但近来,
这词有了更加特定的含义。
The old way to make a web application, and the way OpenERP worked until
version 6.0 is to make the server send to the user complete HTML documents
representing the state of the application's GUI. This means the server has to
compute and send a new HTML document for each interaction; buttons clicks,
searches, history navigation all require the server to resend a document.
以前 Web 应用程序的方式,包括 OpenERP6.0 和之前版本的工作机制,是
从服务端向用户端发送的描述应用程序 GUI 状态的整个 HTML 文档。这意味着
服务器为了响应客户端的每个请求交互,如按钮点击,搜索,导航历史记录,都
需要计算和重新发送一个新的 HTML 文档。
This puts a large load on the server and thus severely impact the number of
concurrent users that can be served. It also creates a large latency in the
application that makes the implementation of many features impossible, and
limits what can be achieved in terms of usability.
这给服务器造成极大负载,从而严重限制可服务的并发用户数量。还造成很
大的延迟,致使应用程序很多功能无法实现,限制了可用性的达成。
The solution is to create a complete and standalone application in JavaScript
that runs on the user's web browser. That type of application comes to have
much more in common with traditional desktop applications (example: GTK,
剩余140页未读,继续阅读
feifly329
- 粉丝: 6
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4