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 视频下载: 百度 ...
随机推荐
- 【Java多线程】线程池学习
Java线程池学习 众所周知,Java不仅提供了线程,也提供了线程池库给我们使用,那么今天来学学线程池的具体使用以及线程池基本实现原理分析. ThreadPoolExecutor ThreadPool ...
- [Codeforces #188] Tutorial
Link: Codeoforces #188 传送门 A: 先全转为正数,后面就全是指数级增长了 #include <bits/stdc++.h> using namespace std; ...
- AGC 012 D - Colorful Balls
题面在这里! 为什么atcoder都是神仙题啊qwq 首先发现如果要让 x,y 互换位置的话,要么通过他们直接换 (也就是x和y满足两种操作之一),要么间接换,通过一些其他的元素形如 x可以和 a[1 ...
- 【差分约束系统】【最短路】【spfa】CDOJ1646 穷且益坚, 不坠青云之志。
求一个有n个元素的数列,满足任意连续p个数的和不小于s, 任意连续q个数的和不大于t. 令sum[i]表示前i项的和(0<=i<=n,sum[0]=0) 那么题目的条件可转化为: sum[ ...
- Problem A: 零起点学算法91——找出一个数组中出现次数最多的那个元素
#include<stdio.h> int main() { ],b[]={}; while(scanf("%d",&n)!=EOF) { ;i<n;i+ ...
- 将HTML表格的每行每列转为数组,采集表格数据
将HTML表格的每行每列转为数组,采集表格数据 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 //将HTML ...
- ms_sql_server_architecture
We have classified the architecture of SQL Server into the following parts for easy understanding − ...
- 使用XML向SQL Server 2005批量写入数据——一次有关XML时间格式的折腾经历
使用XML向SQL Server 2005批量写入数据——一次有关XML时间格式的折腾经历 原文:使用XML向SQL Server 2005批量写入数据——一次有关XML时间格式的折腾经历 常常遇 ...
- vue-router 2.0 改变的内容
2.x 版本的 vue-router 相比之前的0.7.x版本,有很多破坏性改变: 通用 API 的修改 The old router.go() is now router.push() . 新的 r ...
- luci框架-LUA的一个web框架使用
转自:http://blog.csdn.net/initphp/article/details/17527639 LUCI 这个在百度上搜索除了一篇我的百度文库 luci 的介绍文章之外,前三页都是些 ...