为什么我得到错误:'method_descriptor'对象没有属性'now'?

时间:2015-08-13 12:08:08

标签: python python-2.7 datetime odoo-8 odoo

如果我运行方法

from datetime import datetime
from timedelta import time 

def action_retbook(self, cr, uid, ids, context=None): 
    dt = datetime.date.now() 
    todaydate = datetime.strptime(dt, "%y/%m/%d") 
    x=6 
    cr.execute("""update rmkbook_issue set dt_of_return ='%s' where id= %s """ %(todaydate, x)) 
    return

我收到错误'method_descriptor' object has no attribute 'now'。为什么呢?

2 个答案:

答案 0 :(得分:3)

你可以像这样运行now()方法:

...
<body>
    ...
    <div v-el='target_element'></div>
    ...
</body>

您也可以查看this question

答案 1 :(得分:0)

我相信

useRef()

Works ..