【问题标题】:get product precision in openerp report parser在 openerp 报告解析器中获取产品精度
【发布时间】:2016-02-28 03:39:56
【问题描述】:

我想在report parser 中获得产品精度,以便在RML 代码中使用它来替换get_digits 方法。

我有这个代码:

class my_report(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(my_report, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time,
            'precision': self.get_precision,
        })
    def get_precision(self, product):
        ...
        return precision

有可能吗?

【问题讨论】:

  • 你试过给出答案了吗?

标签: python openerp rml


【解决方案1】:

是的,这是可能的。

例如,我的 .rml 文件中有以下行。我们可以直接分配任何静态值,例如

[[ formatLang(line.price_unit, digits=4) ]]

【讨论】:

  • 我想要一些类似的东西:digits=_function()
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-17
  • 1970-01-01
  • 2014-02-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多