摘要: odoo pivot视图,目前发现常用属性有三个 type="measure" : 主要是用来统计数据的总数; type="row" : 主要用来设置横向列; type="col" 主要用来设置纵向列; 如果有一个字段需要统计的不是总数而是平均值, 可以在字段上添加属性:group_operator 阅读全文
posted @ 2017-10-09 16:16 Bruce_pt 阅读(1863) 评论(0) 推荐(0) 编辑
摘要: Postgresql 当中有四种方式获取当前时间。 一:now() 通过now()获取的时间是最完整的时间,包括时区,秒也保留到了6位小数。 select now(); 得到的结果如下 '2014-12-24 09:28:31.545145+08' 二:current_timestamp效果是和no 阅读全文
posted @ 2017-10-09 11:31 Bruce_pt 阅读(5492) 评论(1) 推荐(0) 编辑
摘要: 函数:string || string 说明:String concatenation 字符串连接操作例子:'Post' || 'greSQL' = PostgreSQL ? 函数:string || non-string or non-string || string说明:String conca 阅读全文
posted @ 2017-09-20 14:22 Bruce_pt 阅读(4081) 评论(0) 推荐(0) 编辑
摘要: self.env可以是请求的参数或者其他self.env.cr或self._cr是数据库游标对象,用于查询数据库self.env.uid是当前用户的数据库idself.enc.user当前用户的记录self.env.context或self._context是上下文字典self.enc.ref(xm 阅读全文
posted @ 2017-09-07 17:36 Bruce_pt 阅读(654) 评论(0) 推荐(0) 编辑
摘要: 1.首先在xml文件中注册一个报表 <report id="qweb_test_report" model="qweb.test" string="Report Test" report_type="qweb-pdf" name="qweb_test.test_report" file="qweb_ 阅读全文
posted @ 2017-09-06 16:46 Bruce_pt 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1.将字符串的时间转换为时间戳方法:a = "2013-10-10 23:40:00"#将其转换为时间数组import timetimeArray = time.strptime(a, "%Y-%m-%d %H:%M:%S")#转换为时间戳:timeStamp = int(time.mktime(t 阅读全文
posted @ 2017-09-06 13:44 Bruce_pt 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: odoo的tree视同中 可以在每页的最后一列显示该页数的的某一个数值类型的列的数据总数 例如: 图示:重量就是一个数值类型的列 我们可以在 每页的最后显示该列的总数 如: 箭头所示的就是该列的总数 代码如下:在tree视图中增加: <field name="qty" sum="Qty"/> sum 阅读全文
posted @ 2017-08-25 11:33 Bruce_pt 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 安装个easy_install工具 sudo apt-get install python-setuptools 然后sudo就OK了 安装个easy_install工具 sudo apt-get install python-setuptools 然后sudo就OK了 比如Ubuntu下Pytho 阅读全文
posted @ 2017-08-03 13:58 Bruce_pt 阅读(2561) 评论(0) 推荐(0) 编辑
摘要: 取得时间相关的信息的话,要用到python time模块,python time模块里面有很多非常好用的功能,你可以去官方文档了解下,要取的当前时间的话,要取得当前时间的时间戳,时间戳好像是1970年到现在时间相隔的时间。你可以试下下面的方式来取得当前时间的时间戳:import timeprint 阅读全文
posted @ 2017-07-27 14:27 Bruce_pt 阅读(13364) 评论(0) 推荐(0) 编辑
摘要: <tree default_order="sale_date desc">按照 sale_date 字段进行降序排列显示 阅读全文
posted @ 2017-07-25 09:45 Bruce_pt 阅读(1819) 评论(0) 推荐(0) 编辑