Odoo Help

Welcome!

This community 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.

0

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

By
fabys
on 8/5/14, 10:01 PM 717 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'

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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