Commit 5f8f927a authored by Jérome Perrin's avatar Jérome Perrin

*: support Py3 in delivery printouts WIP 🚧

parent 18679b64
import six
translateString = context.Base_translateString translateString = context.Base_translateString
portal = context.getPortalObject() portal = context.getPortalObject()
portal_preferences = portal.portal_preferences portal_preferences = portal.portal_preferences
...@@ -61,9 +62,11 @@ def getPrototype(): ...@@ -61,9 +62,11 @@ def getPrototype():
return None return None
def unicodeDict(d): 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): if isinstance(v, str):
d.update({k:unicode(v, 'utf8')}) d.update({k: unicode(v, 'utf8')})
return d return d
data_dict = { data_dict = {
......
# coding: utf-8 # coding: utf-8
import six
portal = context.getPortalObject() portal = context.getPortalObject()
translateString = portal.Base_translateString translateString = portal.Base_translateString
request = context.REQUEST request = context.REQUEST
...@@ -110,9 +111,11 @@ total_tax_price = 0.0 ...@@ -110,9 +111,11 @@ total_tax_price = 0.0
number_line_not_tax = 0 number_line_not_tax = 0
def unicodeDict(d): 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): if isinstance(v, str):
d.update({k:unicode(v, 'utf8')}) d.update({k: unicode(v, 'utf8')})
return d return d
......
import six
translateString = context.Base_translateString translateString = context.Base_translateString
...@@ -110,9 +111,11 @@ line_list = [] ...@@ -110,9 +111,11 @@ line_list = []
total_price = 0.0 total_price = 0.0
def unicodeDict(d): 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): if isinstance(v, str):
d.update({k:unicode(v, 'utf8')}) d.update({k: unicode(v, 'utf8')})
return d return d
line_list = context.PaySheetTransaction_getLineListAsDict() line_list = context.PaySheetTransaction_getLineListAsDict()
......
import six
portal = context.getPortalObject() portal = context.getPortalObject()
translateString = portal.Base_translateString translateString = portal.Base_translateString
request = context.REQUEST request = context.REQUEST
...@@ -166,9 +167,11 @@ year_to_date_taxable_net_salary = paysheet.PaySheetTransaction_getYearToDateSlic ...@@ -166,9 +167,11 @@ year_to_date_taxable_net_salary = paysheet.PaySheetTransaction_getYearToDateSlic
'base_contribution/base_amount/payroll/base/income_tax') 'base_contribution/base_amount/payroll/base/income_tax')
def unicodeDict(d): 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): if isinstance(v, str):
d.update({k:unicode(v, 'utf8')}) d.update({k: unicode(v, 'utf8')})
return d return d
source_section = paysheet.getSourceSectionValue() 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