fix lots by location

This commit is contained in:
?ngel ?lvarez 2018-06-12 17:22:09 +02:00
parent fee0a1f148
commit 1eb3240e9e
1 changed files with 0 additions and 11 deletions

View File

@ -36,25 +36,14 @@ class LotsByLocation(Wizard):
def do_open(self, action):
pool = Pool()
Location = pool.get('stock.location')
Lang = pool.get('ir.lang')
context = {}
context['locations'] = Transaction().context.get('active_ids')
date = self.start.forecast_date or datetime.date.max
context['stock_date_end'] = Date(date.year, date.month, date.day)
action['pyson_context'] = PYSONEncoder().encode(context)
locations = Location.browse(context['locations'])
for code in [Transaction().language, 'en_US']:
langs = Lang.search([
('code', '=', code),
])
if langs:
break
lang = langs[0]
date = Lang.strftime(date, lang.code, lang.date)
action['name'] += ' - (%s) @ %s' % (
','.join(l.name for l in locations), date)
return action, {}