[FIX] ir_sequence: using ir_sequence_date in context now correctly interpolate the next char

This commit is contained in:
qdp-odoo
2015-02-02 11:05:14 +01:00
parent 72db7633b1
commit 4e70eaea4a
+4 -1
View File
@@ -211,7 +211,10 @@ class ir_sequence(models.Model):
return ''
def _interpolation_dict():
t = time.localtime() # Actually, the server is always in UTC.
if self.env.context.get('ir_sequence_date'):
t = time.strptime(self.env.context.get('ir_sequence_date'), '%Y-%m-%d')
else:
t = time.localtime() # Actually, the server is always in UTC.
return {
'year': time.strftime('%Y', t),
'month': time.strftime('%m', t),