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的更多相关文章

  1. openerp 常见问题 OpenERP为什么选择了时区后时间还是不对?(转载)

    OpenERP为什么选择了时区后时间还是不对? 原文地址:http://cn.openerp.cn/%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9%E4%B ...

  2. OpenERP 7中 openerp-server.conf 的解释

    服务器启动配置 – 通用项 程序代码: [选择] # Admin password for creating, restoring and backing up databases admin_pas ...

  3. Odoo(OpenERP)配置文件详解

    [options] ; addons模块的查找路径 addons_path = E:\GreenOdoo8.0\source\openerp\addons ; 管理员主控密码(用于创建.还原和备份数据 ...

  4. 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 ...

  5. Date, TimeZone, MongoDB, java中date的时区问题

    打印new Date(),Fri Aug 12 13:37:51 CST 2016. 显示Asia/Shanghai的时区,但是date toString 的时区简写却是CST.更坑爹的是,Googl ...

  6. OpenERP 使用与开发笔记(一)

    一直关注OpenERP,但一直未真正使用.最近一些数据想规范管理,免得使和EXCEL与WORD等到处找,所以想到OpenERP的自定义功能比较好,就再次找来相关资料重新拾掇起来.在这过程中,发现了许多 ...

  7. HowTo: Linux Server Change OR Setup The Timezone

    Method 1 #tzselect # select timezone e.g. Asia/Shanghai#echo 'Asia/Shanghai' > /etc/timezone # se ...

  8. Lumen 设置 timezone 时区

    Lumen 设置 timezone 时区 2015-06-19| wid| 后端开发 今天用 Lumen 框架写代码时, 也是初次体验 Lumen, 遇到了一个问题, 从数据库里查出的时间比数据库里保 ...

  9. ubuntu 12.04上安装OpenERP 7的一次记录

    登陆ssh, 先更新系统: sudo apt-get update && sudo apt-get dist-upgrade 接着再为openerp运行创建一个系统用户,用户名就叫op ...

随机推荐

  1. Html基本操作实例代码

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD ...

  2. 用swift开发仪表盘控件(一)

    苹果swift刚刚推出不久,接触到这个语言是一个偶然的机会,无聊之余随便看了下它的语法: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveW5tYW95b2 ...

  3. HTML5 vs FLASH vs SILVERLIGHT

    Introduction HTML5 kills off flash; HTML5 kills off Silverlight; HTML5 makes the dinner and does the ...

  4. python文本 判断对象里面是否是类字符串

    python文本 判断对象里面是否是类字符串 场景: 判断对象里面是否是类字符串 一般立刻会想到使用type()来实现 >>> def isExactlyAString(obj):  ...

  5. Arcgis10.5 python按属性分割图层,属性相同分为一个图层

    # coding=utf-8 """ Source code for potential gp tool to create outputs based on attri ...

  6. CAShapeLayer的path动画

    CAShapeLayer的path动画 效果 源码 https://github.com/YouXianMing/Animations // // CAShapeLayerPathController ...

  7. 使用开源库 TWMessageBarManager 展示系统级别的通知

    TWMessageBarManager 简单翻译 https://github.com/terryworona/TWMessageBarManager An iOS manager for prese ...

  8. Cocos2dx 小技巧(十四)ScrollView实现缩放效果

    这阶段心绪比較乱,所以这篇开头就不扯淡了.(谁说大姨夫来了我跟谁急!~~)说到大姨夫我突然想到英雄联盟有个美女讲解叫伊芙蕾亚,她的堂弟ID居然叫:姨夫累呀,好笑吧(呵呵,有点冷~~额,我都说不扯淡了) ...

  9. 垃圾收集(GC)中如何确定哪些内存是"垃圾

    垃圾收集(Garbage Collection,GC),要设计一个GC,需要考虑解决下面三件事情:(1)哪些内存需要回收?(2)什么时候回收?(3)如何回收? 哪些内存需要回收?根据<Java内 ...

  10. OpenCV学习(31) 基于defects的简单手势

    前几年在做毕业设计时候曾用opencv1.0中defects做过简单的手势识别,这几天看OpenCV2.46中的轮廓函数,发现和以前差别挺大,函数调用完全不一样,重新实现了简单手势的代码. 1.首先用 ...