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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухоблік
- Склад
- PoS
- Project
- MRP
Це запитання позначене
1
Відповісти
4433
Переглядів
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація
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'