Odoo Help


AttributeError: 'int' object has no attribute 'get'

on 8/5/14, 10:01 PM 1,068 views

def _suma_fojas(self, cr, uid, ids, name, arg, context=None):
        if context is None: context = {}
        oficio = {obj.id: sum(oficio_o2m_id.numero_fojas_documento for oficio_o2m_id in obj.oficio_o2m_id)
                        for obj in self.browse(cr, uid, ids, context=context)}
        libro = {obj.id: sum(libro_o2m_id.numero_fojas_documento for libro_o2m_id in obj.libro_o2m_id)
                        for obj in self.browse(cr, uid, ids, context=context)}
        #revista = {obj.id: sum(revista_o2m_id.numero_fojas_documento for revista_o2m_id in obj.revista_o2m_id)
        #        for obj in self.browse(cr, uid, ids, context=context)}
        oficio1 = oficio.values()[0]
        libro1 = libro.values()[0]
        #revista1 = revista.values()[0]
        total= oficio1 + libro1 
        return total

the error message is this : Server Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/server/openerp/netsvc.py", line 296, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, *params) File "/opt/openerp/server/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, **kw or {}) File "/opt/openerp/server/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, *args, **kwargs) File "/opt/openerp/server/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/opt/openerp/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/openerp/server/openerp/osv/orm.py", line 3679, in read result = self._read_flat(cr, user, select, fields, context, load) File "/opt/openerp/server/openerp/osv/orm.py", line 3800, in _read_flat res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res) File "/opt/openerp/server/openerp/osv/fields.py", line 1151, in get elif result.get(id): AttributeError: 'int' object has no attribute 'get'

on 8/5/14, 10:04 PM
On 8/5/14, 10:03 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/5/14, 10:01 PM
Seen: 1068 times
Last updated: 3/16/15, 8:10 AM