如何在sxw中使用python for openerp报告设定日期? [英] How to set date with time in sxw using python for openerp report?

查看:114
本文介绍了如何在sxw中使用python for openerp报告设定日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是openerp的世代报告。那个方法是,我创建了sxw并将其转换成rml,然后将其转换为pdf。现在工作正常我的疑虑是,当试图获得日期和时间的字段值时,它只是日期。时间不在pdf报告中。



python中的字段名称:'sample_receipt_date':datetime(....)


$ b $ sxw中的b

:[[formatLang(o.sample_receipt_date,date = True)]]



转换后pdf:dd / mm / yy



但是我希望这个格式在pdf中是dd / mm / yy / min / sec。



什么是sxw文件中的python编码?

解决方案

[[time.ctime()]] 否则,请查看 https://doc.openerp.com/6.1/ vi / developer / 05_reports / 或完整的 RML for Idiots 手动


I am generation report in openerp. that ways is, I created sxw and convet into rml then rml into pdf. It is working fine now. What my doubts is, when try to get date and time field value, it's getting only date. Time is not coming in pdf report.

Field name in python: 'sample_receipt_date':datetime(....)

in sxw: [[formatLang(o.sample_receipt_date,date=True)]]

After convert pdf: dd/mm/yy

but i want this format dd/mm/yy/min/sec in pdf.

what is python coding in sxw document?

解决方案

[[ time.ctime() ]] should work in RML, otherwise, take a look at https://doc.openerp.com/6.1/vi/developer/05_reports/ or the full RML for Idiots manual

这篇关于如何在sxw中使用python for openerp报告设定日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆