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 ...
随机推荐
- Eclipse复制或修改项目后,把项目部署后发现还是原来的项目名称
Eclipse复制或修改项目后,把项目部署后发现还是原来的项目名称 解决: 到项目根目录打开.setting文件夹,找到"org.eclipse.wst.common.component&q ...
- Arcgis Runtime for andriod 100 加载geodatabase
private void LoadMY(){ try { String mainGeodatabaseFilePath = YLPub.getMapData() + "/gismap/sl. ...
- Oracle中Instr用法
在项目中用到了Oracle中 Instr 这个函数,顺便仔细的再次学习了一下这个知识. Oracle中,可以使用 Instr 函数对某个字符串进行判断,判断其是否含有指定的字符. 其语法为:Instr ...
- 异常:javax.el.PropertyNotFoundException: Property 'id' not found on ..........
在后台action中查询数据库返回的UserInfo对象后 将uDisplayName传递到jsp中,jsp中用${userInfo.uDisplayName}接收值时报错: 异常:javax.el. ...
- 如何判断某版本的.NET Framework是否安装
1..NET Framework .NET Framework2.0 键:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\N ...
- Objective-C:NSNumber类的常见用法
NSNumber基本数据类型包装类: // // main.m // 04-NSNumber // // Created by ma c on 15/8/17. // Copyright (c ...
- 我所遭遇过的游戏中间件--PhysX
我所遭遇过的游戏中间件--PhysX PhysX现在是Nvidia的物理中间件.其特点是简练且功能强大.当我最初拿到PHYSX的SDK时,就发现这个物理中间件比Havok要小很多,但该有的功能都有,甚 ...
- 【转】QT CEF3 消息循环处理
初次写博客,可能有点乱, 按照自己的实际经历谈一下CEF3钟遇到的一些坑,希望对以后的小伙有些帮助. 先说一下经历,当初第一次接触CEF3的时候,没做特殊处理,直接将cef3封装成控件,嵌入到QT程序 ...
- linux centos7 安装git
1.下载git wget https://github.com/git/git/archive/v2.14.1.zip 2.安装依赖 yum -y install zlib-devel openssl ...
- LCS 算法
下面的程序分别实现了使用LCS求连续子串和不连续子串的匹配情况! http://beyond316.blog.51cto.com/7367775/1266360