error AttributeError: 'int' object has no attribute 'get' หลังจาก fields.function

แนะนำ สอบถาม ภาษา C สำหรับผู้เริ่มต้น ภาษา Java ภาษา Python

Moderators: mindphp, ผู้ดูแลกระดาน

User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 27264
Joined: 31/03/2014 10:02 am
Contact:

error AttributeError: 'int' object has no attribute 'get' หลังจาก fields.function

Post by thatsawan »

Code: Select all

 def _get_mdtotal(self, cr, uid, ids, fields, arg, context):
        return 10

Server Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\openerp\addons\web\session.py", line 89, in send
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\netsvc.py", line 306, in dispatch_rpc
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\service\web_services.py", line 632, in dispatch
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\osv.py", line 190, in execute_kw
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\osv.py", line 132, in wrapper
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\osv.py", line 199, in execute
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\osv.py", line 187, in execute_cr
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\orm.py", line 4611, in create
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\orm.py", line 4764, in _store_set_values
File "C:\Program Files (x86)\OpenERP 7.0-20170123\server\.\openerp\osv\fields.py", line 1171, in get
AttributeError: 'int' object has no attribute 'get'
User avatar
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
Posts: 25929
Joined: 22/09/2008 6:18 pm
Contact:

Re: error AttributeError: 'int' object has no attribute 'get' หลังจาก fields.function

Post by mindphp »

ต้องปรับ return เป็น dic
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Programming - C/C++ & java & Python”

Who is online

Users browsing this forum: No registered users and 5 guests