How to set up OpenERP for various timezone kindly follow the following steps to select timezone in OpenERP
How to set up OpenERP for different Time Zones
Click on the “Edit Preferences” wheel at top right corner
How to set up OpenERP for different Time Zones
Click on the “Preferences” tab
How to set up OpenERP for different Time Zones
Select the timezone from Drop Down Menu
Following code will be working for “GMT-x” time zones. Mostly US based.
FMT = ”%Y-%m-%d %H:%M:%S” #Time Format
#########################Timezone Logic########################
timezone_time = self.pool.get(”res.users”).browse(cr,uid,uid).context_tz #Timezone selected in OpenERP
now_utc = datetime.now(timezone(”UTC”)) #fetching UTC time
now_utc1 = str(now_utc)[:19] #Truncating time only
now_tm = datetime.now() #system time
current_now = str(now_tm)[:19] #Truncating system time only
if timezone_time:
current_timezone = now_utc.astimezone(timezone(timezone_time)) #getting the time of selected timezone
current_timezone = str(current_timezone)[:19] #Truncating timezone time only
else:
current_timezone = current_now #Current time
###############################################################
#Difference between the UTC and Timezone time
UTC_timezn = datetime.strptime(now_utc1, FMT) – datetime.strptime(current_timezone, FMT)
#Difference between the Current and Timezone time
currnt_timezn = datetime.strptime(current_now, FMT) – datetime.strptime(current_timezone, FMT)
openerp_selected_tm = self.browse(cr,uid,ids[0]).last_ebay_order_import_date #getting user selected time from OpenERP
currentTimeFrom = datetime.strptime(openerp_selected_tm, FMT) – currnt_timezn #Subtracting the currnt_timezn from user selected time
Final_time = currentTimeFrom + UTC_timezn #Final time by adding UTC_timezn
How to set up OpenERP for various timezone kindly follow the following steps to select timezone in OpenERP的更多相关文章
- openerp 常见问题 OpenERP为什么选择了时区后时间还是不对?(转载)
OpenERP为什么选择了时区后时间还是不对? 原文地址:http://cn.openerp.cn/%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9%E4%B ...
- OpenERP 7中 openerp-server.conf 的解释
服务器启动配置 – 通用项 程序代码: [选择] # Admin password for creating, restoring and backing up databases admin_pas ...
- Odoo(OpenERP)配置文件详解
[options] ; addons模块的查找路径 addons_path = E:\GreenOdoo8.0\source\openerp\addons ; 管理员主控密码(用于创建.还原和备份数据 ...
- Warning: strftime(): It is not safe to rely on the system's timezone settings.
当运行程序时,会出现如下警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. You a ...
- Date, TimeZone, MongoDB, java中date的时区问题
打印new Date(),Fri Aug 12 13:37:51 CST 2016. 显示Asia/Shanghai的时区,但是date toString 的时区简写却是CST.更坑爹的是,Googl ...
- OpenERP 使用与开发笔记(一)
一直关注OpenERP,但一直未真正使用.最近一些数据想规范管理,免得使和EXCEL与WORD等到处找,所以想到OpenERP的自定义功能比较好,就再次找来相关资料重新拾掇起来.在这过程中,发现了许多 ...
- HowTo: Linux Server Change OR Setup The Timezone
Method 1 #tzselect # select timezone e.g. Asia/Shanghai#echo 'Asia/Shanghai' > /etc/timezone # se ...
- Lumen 设置 timezone 时区
Lumen 设置 timezone 时区 2015-06-19| wid| 后端开发 今天用 Lumen 框架写代码时, 也是初次体验 Lumen, 遇到了一个问题, 从数据库里查出的时间比数据库里保 ...
- ubuntu 12.04上安装OpenERP 7的一次记录
登陆ssh, 先更新系统: sudo apt-get update && sudo apt-get dist-upgrade 接着再为openerp运行创建一个系统用户,用户名就叫op ...
随机推荐
- OPC Server开发的几大境界
OPC server的开发相对OPC client 更加困难,OPC server 的开发主要应用COM技术,主要应用书籍为潘爱民写的<COM入门和应用>,大量的技术有很大的可重用性,在开 ...
- MVC文件上传02-使用HttpPostedFileBase上传多个文件
本篇体验上传多个文件.兄弟篇为: MVC文件上传01-使用jquery异步上传并客户端验证类型和大小 MVC最基本上传文件方式中的一个遗漏点 □ 前台视图部分 1: <% u ...
- java内存模型知识点汇总
1.像windows/linux这种操作系统中,自带jvm么?以方便java程序的运行? 答:是的,一般操作系统都自带jvm的.但不带jdk,也就是说java的运行环境有,但编译环境没有. 1.jav ...
- 一直困扰设计师多年的Android 单位 dp
轻松理解Android开发单位DP ,让设计与开发高度匹配,整合了网上各大资料汇总一个通俗易懂的. 一直困扰设计师多年的Android 单位 dp 设计这么多年了,相信很多设计师,一直被DP搞得晕头转 ...
- jquery 判断元素是否存在于数组中
要判断数组中是否包含某个元素,从原理来来说,就是遍历整个数组,然后判断是否相等 可以使用Jquery提供的方法: $.inArray("元素(字符串)",数组名称) 进行判断 ,当 ...
- 关于Themleaf学习总结
此篇记录学习Themleaf测试的相关用例: study01 Thymeleaf 的HelloWorld级别的例子 简单介绍Thymeleaf的工作流程 study02 使用spring.thymel ...
- [Mongo] 解决mongoose不支持条件操作符 $gt$gte:$lte$ne $in $all $not
reference : http://blog.sina.com.cn/s/blog_4df23d840100u25x.html 找到mongoose的安装目录 /usr/local/lib/node ...
- Spring Validation
Spring Validation模块用于表单数据验证配置,示例如下 依赖Jar包 <dependency> <groupId>javax.validation</gro ...
- 数学图形(1.2)Sin曲线
相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815 Sin曲线 vertices = x = *PI) to (*PI) y = ...
- 【转载】Hybrid APP了解
原文:http://uikoo9.com/blog/detail/hpp 不错的hybrid app框架:http://www.dcloud.io/case/#group-1 HPP hybirdAp ...