Commit c7c950a9 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

*: support Py3 in delivery printouts WIP 🚧

parent b5428067
import six
translateString = context.Base_translateString
portal = context.getPortalObject()
portal_preferences = portal.portal_preferences
......@@ -61,9 +62,11 @@ def getPrototype():
return None
def unicodeDict(d):
for k, v in d.items():
if six.PY3:
return d
for k, v in six.iteritems(d):
if isinstance(v, str):
d.update({k:unicode(v, 'utf8')})
d.update({k: unicode(v, 'utf8')})
return d
data_dict = {
......
# coding: utf-8
import six
portal = context.getPortalObject()
translateString = portal.Base_translateString
request = context.REQUEST
......@@ -110,9 +111,11 @@ total_tax_price = 0.0
number_line_not_tax = 0
def unicodeDict(d):
for k, v in d.items():
if six.PY3:
return d
for k, v in six.iteritems(d):
if isinstance(v, str):
d.update({k:unicode(v, 'utf8')})
d.update({k: unicode(v, 'utf8')})
return d
......
import six
translateString = context.Base_translateString
......@@ -110,9 +111,11 @@ line_list = []
total_price = 0.0
def unicodeDict(d):
for k, v in d.items():
if six.PY3:
return d
for k, v in six.iteritems(d):
if isinstance(v, str):
d.update({k:unicode(v, 'utf8')})
d.update({k: unicode(v, 'utf8')})
return d
line_list = context.PaySheetTransaction_getLineListAsDict()
......
import six
portal = context.getPortalObject()
translateString = portal.Base_translateString
request = context.REQUEST
......@@ -166,9 +167,11 @@ year_to_date_taxable_net_salary = paysheet.PaySheetTransaction_getYearToDateSlic
'base_contribution/base_amount/payroll/base/income_tax')
def unicodeDict(d):
for k, v in d.items():
if six.PY3:
return d
for k, v in six.iteritems(d):
if isinstance(v, str):
d.update({k:unicode(v, 'utf8')})
d.update({k: unicode(v, 'utf8')})
return d
source_section = paysheet.getSourceSectionValue()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment