fix lots by location
This commit is contained in:
parent
fee0a1f148
commit
1eb3240e9e
11
location.py
11
location.py
|
@ -36,25 +36,14 @@ class LotsByLocation(Wizard):
|
||||||
def do_open(self, action):
|
def do_open(self, action):
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
Location = pool.get('stock.location')
|
Location = pool.get('stock.location')
|
||||||
Lang = pool.get('ir.lang')
|
|
||||||
|
|
||||||
context = {}
|
context = {}
|
||||||
context['locations'] = Transaction().context.get('active_ids')
|
context['locations'] = Transaction().context.get('active_ids')
|
||||||
date = self.start.forecast_date or datetime.date.max
|
date = self.start.forecast_date or datetime.date.max
|
||||||
context['stock_date_end'] = Date(date.year, date.month, date.day)
|
context['stock_date_end'] = Date(date.year, date.month, date.day)
|
||||||
action['pyson_context'] = PYSONEncoder().encode(context)
|
action['pyson_context'] = PYSONEncoder().encode(context)
|
||||||
|
|
||||||
locations = Location.browse(context['locations'])
|
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' % (
|
action['name'] += ' - (%s) @ %s' % (
|
||||||
','.join(l.name for l in locations), date)
|
','.join(l.name for l in locations), date)
|
||||||
return action, {}
|
return action, {}
|
||||||
|
|
Loading…
Reference in New Issue