Skip to content

Commit

Permalink
speed up name_get
Browse files Browse the repository at this point in the history
  • Loading branch information
carlo committed Aug 29, 2018
1 parent 06cea5e commit 1a7e334
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l10n_it_sale/models/inherit_stock_picking.py
Expand Up @@ -33,12 +33,12 @@ class stock_picking(orm.Model):
'cig': fields.char('CIG', size=64, help="Codice identificativo di gara"),
'cup': fields.char('CUP', size=64, help="Codice unico di Progetto")
}

def name_get(self, cr, uid, ids, context=None):
context = context or self.pool['res.users'].context_get(cr, uid)
res = []
for picking in self.browse(cr, uid, ids, context):
res.append((picking.id, picking.ddt_number or picking.ddt_in_reference or picking.name))
for picking in self.read(cr, uid, ids, ['id', 'ddt_number', 'ddt_in_reference', 'name'], context):
res.append((picking['id'], picking['ddt_number'] or picking['ddt_in_reference'] or picking['name']))
return res

def _check_ddt_in_reference_unique(self, cr, uid, ids, context=None):
Expand Down

0 comments on commit 1a7e334

Please sign in to comment.