Openerp开发进销存系统总结
转自 :http://blog.sina.com.cn/s/blog_7cb52fa80101ngt8.html
差不多用了2个星期的闲余事件,对于openerp v7.0进行了学习和应用开发。细节总结如下
安装Openoffice
在openoffice中安装openerp report designer插件(openerp 7.0中自带)
OpenErp学习
安装Openoffice
在openoffice中安装openerp report designer插件(openerp 7.0中自带)
1.保存openoffice文件在英文路径下。如果不保存,send to server的时候会没有反应
2. 主要类
osv openerp/osv/osv.py
在文件中 osv = Model
所以osv.osv和osv.Model其实是一样的
osv.Model定义在orm.py中
report_sxw openerp/report/report_sxw.py
logging python库自带
import logging
_logger = logging.getLogger(__name__)
_logger.error("IntegrityError", exc_info=True)
raise osv.except_osv('xinquanda_product', "_modify_quantity 0"%(record[0]['quantity']))
3.使用openerp report design + openoffice 3.4 + openerp 7.0
在send to server的时候会提示UnicodeDecodeError: 'ascii' codec can't decode byte
通过在addons\base_report_designer\base_report_designer.py添加如下三行代码解决
注意默认使用空格缩进。如果增加的代码使用tab缩进会产生unexpected indent错误
import sys
def upload_report(self, cr, uid, report_id, file_sxw, file_type, context=None):
'''
Untested function
'''
reload(sys)
sys.setdefaultencoding('utf8')
4.python 一个 *.py就是一个package
osv.osv就是osv.py文件内的osv对象
5.使用parent_id的时候,使用toolbar产生问题
6.selection里面使用中文内容,需要在前面增加u, 比如u'供货商'。否则插入的时候会判断出错
7.使用7.0 form如果没有sheet和group,会不显示filed string
8.使用openerp report designer自动生成rml会使用in作为object名。会导致在7.0下面无法解析。提示 cannot eval 'xxxx'之类的。修改名字解决问题
9.Win7的字体安装直接拖进去是不行的。文件名会变成xxx_1 xxx_2这样(用cmd查看)。所以需要使用cmd的xcopy命令进行放置。否则会安装了新字体,但是还是乱码。使用xcopy进去以后,虽然图形界面看不到该字体安装成功了。但是重启oe之后可以解决乱码问题。如果还不行尝试重启一下系统吧。
10.一个工程中存在相同的view_id导致了显示不出来同名menu
11.
View生成的时候调用的初始化函数
def view_init(self, cr, uid, fields_list, context=None):
使用菜单栏的导出功能,导出Field数据时调用
def export_data(self, cr, uid, ids, fields_to_export, context=None):
加载数据时调用,返回一个id list.代表需要加载的数据
def load(self, cr, uid, fields, data, context=None):
"""
Attempts to load the data matrix, and returns a list of ids (or
``False`` if there was an error and no id could be generated) and a
list of messages.
The ids are those of the records created and saved (in database), in
the same order they were extracted from the file. They can be passed
directly to :meth:`~read`
#
# Overload this method if you need a window title which depends on the context
#
def view_header_get(self, cr, user, view_id=None, view_type='form', context=None):
return False
// 获取名字,返回名字列表
def name_get(self, cr, user, ids, context=None):
// 根据参数进行名字查找.返回 (id, name)的tuple列表.相当于先用search进行搜索,然后再用name_get获取名字列表
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
// 仅仅使用name创建record
def name_create(self, cr, uid, name, context=None):
create
read
返回的是dict组成的list
write
unlink
def search(cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
cr.execute
cr.fetchall
// 定义了
def func_search(self, cr, uid, obj, name field, args, context):
12. pgsql的备份与恢复
pg_dump.exe -f d:/backup/1234.backup -F t -h 127.0.0.1 -p 5432 -U openerp -b Erp
pg_restore.exe -F t -h 127.0.0.1 -p 5432 -U openerp -d tt d:/backup/1234.backup
13.
c:\>for /f "tokens=1-3 delims=- " %1 in ("�te%") do @echo %1%2%3
c:\>for /f "tokens=1-3 delims=.: " %1 in ("%time%") do @echo %1%2%3
http://www.jb51.net/article/30539.htm
14.
report name一样导致了report对应的model调用错误
15.
select 'cp' || right(cast(pow(10, 10) as varchar) || id, 10) as sn, customer_id as name, '付款' as operation, pay_value as value, date, note from xinquanda_customer_payment
union
select 'co' || right(cast(pow(10, 10) as varchar) || id, 10) as sn, customer_id as name, '退货' as operation, price_totle as value, date , '' as note from xinquanda_product_customer_out
union
select 'ci' || right(cast(pow(10, 10) as varchar) || id, 10) as sn, customer_id as name, '供货' as operation, price_totle as value, date , '' as note from xinquanda_product_customer_in;
16.有关于view视图的创建与显示
1.在.py的对象创建里面定义_auto = False
2.所有_column都需要有readonly=True的属性
3._sql设定视图创建sql语句或者在__init__(self, cr)函数里面创建具体视图
如果调用视图的action使用了tree type进行显示,可能会在报错
2013-06-19 01:36:24,151 2392
Openerp开发进销存系统总结的更多相关文章
- openerp 经典收藏 Openerp开发进销存系统完毕总结(转载)
原文地址:http://blog.csdn.net/heartrude/article/details/9142463 Openerp开发进销存系统完毕总结 分类: 代码历程 OpenERP 工程思想 ...
- Openerp开发进销存系统完毕总结
转自:http://blog.csdn.net/heartrude/article/details/9142463 安装Openoffice 在openoffice中安装openerp repor ...
- [系统开发] FileMaker进销存系统
一.简介 这是我用 FileMaker 编写的进销存系统: FileMaker 是一种在欧美流行的桌面型数据库:它使用非常方便,功能也很强大,用户可以在它上面开发自己的系统: 开发时间:2008年 二 ...
- C# WINFORM进销存系统开发(内涵免费源码+部分实操视频讲解)
互联网的时代,电商火爆,大家都开始进行线上销售货品,那你是如何管理你的商品库存和进销问题?软积木--小敏用的是C# WINFORM进销存系统来管理我的数据,给我带来了很多便利. 它是高频需求项目,很多 ...
- spring boot的一个小项目小型进销存系统
项目所需的依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId&g ...
- 浩瀚技术团队... 安卓智能POS移动PDA开单器 开单器 进销存系统 进销存系统
浩瀚技术团队... 智能POS移动PDA开单器 开单器 进销存系统 进销存系统 点餐 会员管理 会员管理 深度解读 手机APP移动办公到底是什么? 快速打单POS·不仅仅是快那么简单!
- PDA手持机 移动开单进销存系统 现场出打印凭据和扫码 新的亮点
传统车销模式弊端:1.手写开单,效率低,动作慢2.现场手写开单明细不能打印,产品明细不规范3.电脑办公人员及车销人员对车上的库存情况掌握不清楚,销售人员对每种产品销售价格不清楚4.老板对员工工作的管控 ...
- 最新发布C#.NET快速开发框架企业版V4.0 (适合开发ERP、进销存系统)
C/S系统开发框架-企业版 V4.0 (Enterprise Edition) http://www.csframework.com/cs-framework-4.0.htm 视频下载: 百度网盘: ...
- C# 进销存系统开发框架
C/S系统开发框架-企业版 V4.0 (Enterprise Edition) 简介: http://www.csframework.com/cs-framework-4.0.htm 视频下载: 百度 ...
随机推荐
- 01Trie【p4551(poj3764)】 最长异或路径
题目描述 给定一棵 n 个点的带权树,结点下标从 1 开始到 N .寻找树中找两个结点,求最长的异或路径. 异或路径指的是指两个结点之间唯一路径上的所有边权的异或. 个人: 首先强推一下01字典树(T ...
- 解决PHPExcel长数字串显示为科学计数
在excel中如果在一个默认的格中输入或复制超长数字字符串,它会显示为科学计算法,例如身份证号码,解决方法是把表格设置文本格式或在输入前加一个单引号. 使用PHPExcel来生成excel,也会遇到同 ...
- hibernate双向ManyToMany映射
工作需要一个双向多对多映射,照着李刚的书做了映射,碰到了一些问题,现就问题及解决方案进行总结归纳. 1.首先奉上最初代码 Person5.java @Entity @Table(name = &quo ...
- Problem B: 判断回文字符串
#include<stdio.h> #include<string.h> int huiwen(char *str) //定义回文函数 { //char ch[100]; in ...
- 解决 javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
解决这个异常的重点就在于下载两个jar包: bcprov-ext-jdk15on-1.52 bcprov-jdk15on-1.52 传送门:https://stackoverflow.com/ques ...
- POJ 3680 Intervals(费用流)
Intervals Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5762 Accepted: 2288 Descrip ...
- FIS常用功能之资源压缩
fis server start后 资源压缩,只需要使用命令,不需要添加任何配置 fis release --optimize 或: fis release -o 在浏览器访问按F12,观看压缩前后文 ...
- this和$(this)的关系
环境关键字this引用的是DOM元素 $(this)是jQuery对象 下面点击按钮分别alert一下 alert(this); alert($(this)); 获取DOM对象的属性id,可以 $(t ...
- Oracle 11gR2 RAC连接时ORA-12545错误
刚装成的Oracle 11gR2的RAC集群 三个节点 创建好数据库,一切都在正常的进行中 然后去安装了一个oracle client,进行链接时出现了ORA-12545 然后简单的baidu了一下, ...
- Unity3d-Socket之龙一编年史network.dll分析(1)
今天闲着无聊,看到群里的老大共享了反编译的工具,就下载下来玩下. 说道反编译我个人不太推崇反编译,感觉不道德,毕竟是人家的代码,但是又回想一下,我们拿代码看是抱着学习的态度又有何不可,所谓既是民族的也 ...