我的問題得到名單的價值:在日誌ODOO '功能' 對象有沒有屬性 '__getitem__'
def _get_state(self, cr, uid, context=None):
idemployee = _default_employee(self, cr, uid, context=None)
# sql = " SELECT id, sequence, name FROM wf_state ORDER BY sequence "
sql = " SELECT C.id AS id, C.sequence, C.name, member_id, name_related AS employee_name, \
B.name AS group_name, C.name AS state_name FROM wf_group_member A \
LEFT JOIN wf_group B ON B.id = A.group_id \
LEFT JOIN wf_process BB ON BB.id = B.process_id\
LEFT JOIN wf_state C ON C.group_id = B.id \
LEFT JOIN hr_employee D ON D.id = A.member_id \
WHERE LOWER(code) = 'ca' AND member_id = %s ORDER BY sequence "
res = []
cr.execute(sql, [(idemployee)])
ardata = cr.fetchall()
for data in ardata:
# res.append((data[1], data[2]))
res.append((data[1], data[2]))
return res
array_state = _get_state
class cashadvance(osv.osv):
_name = 'ga.cashadvance'
_columns = {
'state' : fields.selection(array_state, 'Status', readonly=True, required=True),
}
_defaults={
'state' : array_state[0][0],
}
錯誤是: '狀態':array_state [0] [0], 類型錯誤:「功能」對象有沒有屬性「getitem_」
請幫我在這
如果以下任何答案沒有正確解決您的問題,請嘗試通過標記答案或做出進一步評論來關閉此問題,如果您不提供反饋,問題仍然存在,並且標記答案是一種方式說謝謝誰回答你的問題,這顯然是@kenly – danidee
好吧,謝謝你提醒我:) – yogakumboro
這不是全部,在upvote和downvote箭頭下,你會看到一個灰色的複選標誌,點擊它來標記答案爲正確的一個....它會變成綠色,當你這樣做...之後,刪除你的答案你發佈它應該是一個評論,而不是 – danidee