我正在通過在odoo中的會計選項卡中過濾的過濾器添加組。並想獲取上下文due_date <當前日期,但我沒有得到當前日期任何地方,我不知道我怎麼能得到它,有人可以告訴我,如何獲得odoo當前日期?如何在odoo中獲取xml中的當前日期?
這裏是我組通過過濾器
<xpath expr="//filter[@string='Due Month']" position="after
<filter string="Past Due" context="{'group_by':'date_due < current date'}"/>
</xpath>
這裏是我的其他代碼中,我做到了與計算領域,但並不怎麼我可以得到當前的日期
@api.depends('date_due')
@api.multi
def _compute_due_date(self):
for record in self:
record.past_due = record.date_due < record.date.today().strftime('%Y-%m-%d')
電流場日期不存在有 –
它不應該被使用的字段值。 'current_date'是一個全局變量。 –
嗯......它可能''current_date'在上下文中不可用。 –