Add support for generic "product" batch type

This commit is contained in:
Lance Edgar 2019-04-19 13:23:21 -05:00
parent 4a5f1ce19a
commit 2c1985bef3
5 changed files with 221 additions and 9 deletions

View file

@ -2507,6 +2507,15 @@ class MasterView(View):
if isinstance(value, GPC):
value = six.text_type(value)
elif isinstance(value, datetime.datetime):
# datetime values we provide to Excel must *not* have time zone info,
# but we should make sure they're in "local" time zone effectively.
# note however, this assumes a "naive" time value is in UTC zone!
if value.tzinfo:
value = localtime(self.rattail_config, value, tzinfo=False)
else:
value = localtime(self.rattail_config, value, from_utc=True, tzinfo=False)
xlrow[field] = value
return xlrow