Commit 938f4bc7 authored by Ivan Tyagov's avatar Ivan Tyagov

Merge branch 'master' into cache

Conflicts:
	bt5/erp5_dms_conversion_catalog/SkinTemplateItem/portal_skins/erp5_dms_conversion_catalog/WebPage_preConvertReferencedImageList.xml
	bt5/erp5_dms_conversion_catalog/bt/revision
	product/ERP5OOo/tests/testDmsWithPreConversion.py
parents 1ad62b2b 0be4533e
...@@ -132,9 +132,20 @@ def getTaxLineList(order):\n ...@@ -132,9 +132,20 @@ def getTaxLineList(order):\n
return tax_line_list\n return tax_line_list\n
\n \n
\n \n
\n
line_base_contribution_list = []\n
number = 0\n
line_novat_totalprice = 0\n
line_list = []\n line_list = []\n
line_not_vat = []\n
line_vat = []\n
line_not_vat_has_no_vat = {}\n
total_price = 0.0\n total_price = 0.0\n
total_vat = 0.0\n total_vat = 0.0\n
total_vat_price = 0.0\n
vat_total_list = []\n
taxnumber = 0\n
taxname = \'\'\n
\n \n
def unicodeDict(d):\n def unicodeDict(d):\n
for k, v in d.items():\n for k, v in d.items():\n
...@@ -176,8 +187,23 @@ for line in getSubLineList(context):\n ...@@ -176,8 +187,23 @@ for line in getSubLineList(context):\n
display_id = \'translated_title\'\n display_id = \'translated_title\'\n
if request.get(\'international_form\'):\n if request.get(\'international_form\'):\n
display_id = \'title\'\n display_id = \'title\'\n
desc = (\', \'.join([x[0] for x in\n desc = (\', \'.join([x[0] for x in line.getVariationCategoryItemList(display_id=display_id)]),)\n
line.getVariationCategoryItemList(display_id=display_id)]),)\n is_vat=0\n
portal_preferences = context.getPortalObject().portal_preferences\n
if portal_preferences.getPreferredTaxUseList()==[] :\n
vat="use/trade/tax"\n
is_vat=line.isMemberOf(vat) \n
else:\n
vatlist=portal_preferences.getPreferredTaxUseList() \n
for vat in vatlist:\n
is_vat = is_vat or line.isMemberOf(vat)\n
if not is_vat:\n
if line.getBaseContribution() not in line_base_contribution_list:\n
line_base_contribution_list.append(line.getBaseContribution())\n
taxnumber=line_base_contribution_list.index(line.getBaseContribution())+1\n
else:\n
taxname=line.getBaseContribution()\n
\n
line_dict = {\n line_dict = {\n
\'style_name\': \'Table_20_Contents\',\n \'style_name\': \'Table_20_Contents\',\n
\'left_style_name\': \'Table_20_Contents_20_Left\',\n \'left_style_name\': \'Table_20_Contents_20_Left\',\n
...@@ -187,16 +213,44 @@ for line in getSubLineList(context):\n ...@@ -187,16 +213,44 @@ for line in getSubLineList(context):\n
\'reference\': line.getResource() is not None\\\n \'reference\': line.getResource() is not None\\\n
and line.getResourceValue().getReference() or \'\',\n and line.getResourceValue().getReference() or \'\',\n
\'description\': desc,\n \'description\': desc,\n
\'base_contribution\':line.getBaseContribution() or None,\n
\'use_type\':line.getResourceValue().getUse() or \'\',\n
\'use_type_tax\':is_vat,\n
\'total_quantity\': line.getTotalQuantity() or \'\',\n \'total_quantity\': line.getTotalQuantity() or \'\',\n
\'tax_name\':taxname or \'\',\n
\'tax_number\':taxnumber or \'\',\n
\'quantity_unit\': line.getQuantityUnitTranslatedTitle() or (\n \'quantity_unit\': line.getQuantityUnitTranslatedTitle() or (\n
line.getResource() and line.getResourceValue().getQuantityUnitTranslatedTitle()) or \'\',\n line.getResource() and line.getResourceValue().getQuantityUnitTranslatedTitle()) or \'\',\n
\'stop_date\': getOrderedDate(line.getStopDate()) or \'\',\n \'stop_date\': getOrderedDate(line.getStopDate()) or \'\',\n
\'base_price\': line.getPrice() or \'\',\n \'base_price\': line.getPrice() or \'\',\n
\'total_price\': line.getTotalPrice() or \'\',\n \'total_price\': line.getTotalPrice() or 0,\n
\'specialise_title\' : line.getProperty(\'specialise_title\', \'\'),\n \'specialise_title\' : line.getProperty(\'specialise_title\', \'\'),\n
}\n }\n
total_price += line.getTotalPrice() or 0.0\n \n
if line_dict[\'use_type_tax\']:\n
total_vat_price+=line.getTotalPrice() or 0.0\n
line_vat.append(unicodeDict(line_dict.copy()))\n
else:\n
total_price += line.getTotalPrice() or 0.0\n
line_not_vat.append(unicodeDict(line_dict.copy()))\n
if line_dict[\'base_contribution\'] is None:\n
line_novat_totalprice = line_novat_totalprice + line_dict[\'total_price\']\n
line_not_vat_has_no_vat = {\n
\'tax_name\': None ,\n
\'total_quantity\': line_novat_totalprice,\n
\'base_price\': 0.00 ,\n
\'total_price\': 0.00 ,\n
}\n
line_list.append(unicodeDict(line_dict.copy()))\n line_list.append(unicodeDict(line_dict.copy()))\n
if line_not_vat_has_no_vat != {} :\n
line_vat.append(unicodeDict(line_not_vat_has_no_vat.copy()))\n
for line_each in line_vat:\n
if line_each[\'tax_name\'] in line_base_contribution_list :\n
vatNumber=line_base_contribution_list.index(line_each[\'tax_name\'])+1\n
else:\n
vatNumber=0\n
line_each.update({\'vat_number\': vatNumber})\n
line_vat.sort(key=lambda obj:obj.get(\'vat_number\'))\n
\n \n
inch_cm_ratio = 2.54 / 100.0\n inch_cm_ratio = 2.54 / 100.0\n
\n \n
...@@ -397,11 +451,15 @@ data_dict = {\n ...@@ -397,11 +451,15 @@ data_dict = {\n
\'delivery_mode\': context.getDeliveryModeTranslatedTitle() or \'\',\n \'delivery_mode\': context.getDeliveryModeTranslatedTitle() or \'\',\n
\'incoterm\': context.getIncoterm() and context.getIncotermValue().getCodification() or \'\',\n \'incoterm\': context.getIncoterm() and context.getIncotermValue().getCodification() or \'\',\n
\n \n
\'vat_name_list\':line_base_contribution_list,\n
\'total_price\':total_price+total_vat_price,\n
\'total_price_novat\': total_price,\n \'total_price_novat\': total_price,\n
\'vat_list\': getTaxLineList(context),\n \'vat_list\': total_vat,\n
\'vat_total_price\':total_vat_price,\n
\'description\': getFieldAsLineList(context.getDescription()),\n \'description\': getFieldAsLineList(context.getDescription()),\n
\'specialise_title\': context.getProperty(\'specialise_title\',\'\'),\n \'specialise_title\': context.getProperty(\'specialise_title\',\'\'),\n
\n \'line_vat\':line_vat,\n
\'line_not_vat\':line_not_vat,\n
\'line_list\': line_list,\n \'line_list\': line_list,\n
}\n }\n
\n \n
......
...@@ -211,7 +211,8 @@ system_prefs = dict(\n ...@@ -211,7 +211,8 @@ system_prefs = dict(\n
preferred_client_role_list = [\'client\'],\n preferred_client_role_list = [\'client\'],\n
preferred_sale_use_list = [\'trade/sale\'],\n preferred_sale_use_list = [\'trade/sale\'],\n
preferred_purchase_use_list = [\'trade/purchase\'],\n preferred_purchase_use_list = [\'trade/purchase\'],\n
preferred_packing_use_list = [\'trade/container\'])\n preferred_packing_use_list = [\'trade/container\'],\n
preferred_tax_use_list=[\'trade/tax\'])\n
\n \n
configuration_save.addConfigurationItem(\n configuration_save.addConfigurationItem(\n
\'System Preference Configurator Item\',\n \'System Preference Configurator Item\',\n
......
...@@ -367,6 +367,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -367,6 +367,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
self.assertEquals(['trade/sale'], preference_tool.getPreferredSaleUseList()) self.assertEquals(['trade/sale'], preference_tool.getPreferredSaleUseList())
self.assertEquals(['trade/purchase'], preference_tool.getPreferredPurchaseUseList()) self.assertEquals(['trade/purchase'], preference_tool.getPreferredPurchaseUseList())
self.assertEquals(['trade/container'], preference_tool.getPreferredPackingUseList()) self.assertEquals(['trade/container'], preference_tool.getPreferredPackingUseList())
self.assertEquals(['trade/tax']), preference_tool.getPreferredTaxUseList())
def stepCheckModulesBusinessApplication(self, sequence=None, sequence_list=None, **kw): def stepCheckModulesBusinessApplication(self, sequence=None, sequence_list=None, **kw):
""" """
......
...@@ -50,33 +50,37 @@ ...@@ -50,33 +50,37 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>transition = state_change[\'transition\'].id[len(\'user_\'):]\n <value> <string encoding="cdata"><![CDATA[
"""\n
Generate reference from a string by escaping all non ascii characters.\n
XXX: add support for non-ascii characters using unidecode python library\n
"""\n
transliterate_list = [\'?\', \':\', \';\', \'/\', \'&\', \'=\', \'^\', \'@\', \'>\', \'<\', \']\', \'[\', \'^\', \'\\\\\']\n
\n \n
def TestTitle(object):\n def removeNonAscii(s): \n
"""\n return "".join(i for i in s if ord(i)>44 and ord(i)<123)\n
This is the test for this particular action\n
"""\n
if object.getTitle() == \'truc\':\n
return 1\n
return 0\n
\n \n
object = state_change[\'object\']\n # reference can be used for permanent URL so be friendly to spaces (SEO)\n
s = s.strip()\n
s =s.replace(\' \', \'-\')\n
\n \n
if TestTitle(object):\n s = removeNonAscii(s)\n
method = getattr(context, transition)\n for item in transliterate_list:\n
method()\n s = s.replace(item, \'-\')\n
else:\n \n
kw = {\'error_message\':\'Why do you want to do this ?????\'}\n return s.strip(\'-\')\n
state_change.setWorkflowVariable(object, **kw)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>state_change</string> </value> <value> <string>s</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test_error_message</string> </value> <value> <string>Base_generateReferenceFromString</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<key> <string>group_list</string> </key> <key> <string>group_list</string> </key>
<value> <value>
<list> <list>
<string>left</string> <string>left reply-dialog</string>
<string>right</string> <string>right</string>
<string>center</string> <string>center</string>
<string>bottom</string> <string>bottom</string>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left reply-dialog</string> </key>
<value> <value>
<list> <list>
<string>your_title</string> <string>your_title</string>
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>"""\n
"""\n
This script allows to create a new Discussion Thread.\n This script allows to create a new Discussion Thread.\n
"""\n """\n
from zExceptions import Unauthorized\n
\n
MARKER = [\'\', None, []]\n MARKER = [\'\', None, []]\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
...@@ -62,7 +62,13 @@ person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n ...@@ -62,7 +62,13 @@ person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n \n
version = \'001\'\n version = \'001\'\n
language = portal.Localizer.get_selected_language()\n language = portal.Localizer.get_selected_language()\n
user_assignment_dict = portal.ERP5Site_getPersonAssignmentDict()\n \n
try:\n
user_assignment_dict = portal.ERP5Site_getPersonAssignmentDict()\n
except Unauthorized:\n
# not in all cases current logged in user may access its details\n
user_assignment_dict = {\'group_list\': [], \'site_list\':[]}\n
\n
if group_list in MARKER:\n if group_list in MARKER:\n
group_list = user_assignment_dict[\'group_list\']\n group_list = user_assignment_dict[\'group_list\']\n
if site_list in MARKER:\n if site_list in MARKER:\n
...@@ -72,7 +78,8 @@ if site_list in MARKER:\n ...@@ -72,7 +78,8 @@ if site_list in MARKER:\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n \n
reference = title.replace(\' \', \'-\').replace(\'?\', \'\').replace(\':\', \'\').replace(\'/\', \'\').replace(\'&\', \'\').replace(\'=\', \'\')\n reference = context.Base_generateReferenceFromString(title)\n
\n
existing_document = context.getDocumentValue(reference)\n existing_document = context.getDocumentValue(reference)\n
if existing_document is not None:\n if existing_document is not None:\n
# if there are other document which reference duplicates just add some random part\n # if there are other document which reference duplicates just add some random part\n
...@@ -154,9 +161,7 @@ if send_notification_text not in (\'\', None):\n ...@@ -154,9 +161,7 @@ if send_notification_text not in (\'\', None):\n
\n \n
return context.Base_redirect(form_id,\n return context.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<key> <string>group_list</string> </key> <key> <string>group_list</string> </key>
<value> <value>
<list> <list>
<string>left</string> <string>left reply-dialog</string>
<string>right</string> <string>right</string>
<string>center</string> <string>center</string>
<string>bottom</string> <string>bottom</string>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left reply-dialog</string> </key>
<value> <value>
<list> <list>
<string>your_title</string> <string>your_title</string>
......
119 122
\ No newline at end of file \ No newline at end of file
...@@ -62,10 +62,7 @@ if address not in MARKER and port not in MARKER:\n ...@@ -62,10 +62,7 @@ if address not in MARKER and port not in MARKER:\n
for index_uid in range(len(uid)):\n for index_uid in range(len(uid)):\n
document_relative_url = getRelativeUrl[index_uid]\n document_relative_url = getRelativeUrl[index_uid]\n
document = portal.restrictedTraverse(document_relative_url)\n document = portal.restrictedTraverse(document_relative_url)\n
# XXX: we do check if "data" methods exists on pretending to be Document portal types\n if document.Base_isConvertible():\n
# we need a way to do this by introspection\n
if ((getattr(document, "getData", None) is not None and document.getData() not in MARKER) or \\\n
(getattr(document, "getBaseData", None) is not None and document.getBaseData() not in MARKER)):\n
document.activate(priority=4, tag="conversion").Base_callPreConvert()\n document.activate(priority=4, tag="conversion").Base_callPreConvert()\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -56,11 +56,8 @@ ...@@ -56,11 +56,8 @@
"""\n """\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
portal_type = context.getPortalType()\n if not context.Base_isConvertible():\n
allowed_portal_type_list = portal.getPortalDocumentTypeList() + portal.getPortalEmbeddedDocumentTypeList()\n # no need to convert any non convertible types\n
\n
if portal_type not in allowed_portal_type_list:\n
# no need to convert any non DMS types\n
return\n return\n
\n \n
if kw=={}:\n if kw=={}:\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return true or false based on if document is convertible or not.\n
"""\n
MARKER = (None, \'\',)\n
portal = context.getPortalObject()\n
\n
portal_type = context.getPortalType()\n
allowed_portal_type_list = portal.getPortalDocumentTypeList() + portal.getPortalEmbeddedDocumentTypeList()\n
\n
if portal_type not in allowed_portal_type_list:\n
return False\n
\n
# XXX: we do check if "data" methods exists on pretending to be Document portal types\n
# we need a way to do this by introspection\n
return (getattr(context, "getData", None) is not None and context.getData() not in MARKER) or \\\n
(getattr(context, "getBaseData", None) is not None and context.getBaseData() not in MARKER)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_isConvertible</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
MARKER = (None, \'\',)\n MARKER = (None, \'\',)\n
API_ARGUMENT_LIST = [\'format\', \'display\', \'quality\', \'resolution\']\n API_ARGUMENT_LIST = [\'format\', \'display\', \'display_list\', \'quality\', \'resolution\']\n
validation_state = (\'released\', \'released_alive\', \'published\', \'published_alive\',\n validation_state = (\'released\', \'released_alive\', \'published\', \'published_alive\',\n
\'shared\', \'shared_alive\', \'public\', \'validated\')\n \'shared\', \'shared_alive\', \'public\', \'validated\')\n
\n \n
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3243,6 +3243,12 @@ msgstr "関連する出荷明細書がありません" ...@@ -3243,6 +3243,12 @@ msgstr "関連する出荷明細書がありません"
msgid "No Trade Condition." msgid "No Trade Condition."
msgstr "取引条件がありません。" msgstr "取引条件がありません。"
msgid "No result !"
msgstr "見つかれませんでした!"
msgid "No result."
msgstr "見つかれませんでした。"
msgid "No such document was found." msgid "No such document was found."
msgstr "ドキュメントが見つかりませんでした。" msgstr "ドキュメントが見つかりませんでした。"
......
2012-10-16 arnaud.fontaine
* Add missing translations for 'No result.' and 'No result !'.
2010-07-09 tatuya 2010-07-09 tatuya
* Fix the translations of Internal Packing List. Because they were not consistent. * Fix the translations of Internal Packing List. Because they were not consistent.
......
39 40
\ No newline at end of file \ No newline at end of file
...@@ -65,7 +65,6 @@ class PaypalService(XMLObject): ...@@ -65,7 +65,6 @@ class PaypalService(XMLObject):
def navigate(self, REQUEST=None, **kw): def navigate(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation""" """See Payment Service Interface Documentation"""
self.Base_checkConsistency()
page_template = kw.pop("page_template") page_template = kw.pop("page_template")
paypal_dict = kw.get("paypal_dict", {}) paypal_dict = kw.get("paypal_dict", {})
temp_document = newTempDocument(self, 'id') temp_document = newTempDocument(self, 'id')
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>NVP Url</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>nvp_link_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Email of account</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>service_email_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<string>my_title</string> <string>my_title</string>
<string>my_reference</string> <string>my_reference</string>
<string>my_link_url_string</string> <string>my_link_url_string</string>
<string>my_nvp_link</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -110,6 +111,7 @@ ...@@ -110,6 +111,7 @@
<string>my_service_username</string> <string>my_service_username</string>
<string>my_service_password</string> <string>my_service_password</string>
<string>my_service_signature</string> <string>my_service_signature</string>
<string>my_service_email</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_nvp_link</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_link_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>NVP URL</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_service_email</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Email</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<item> <item>
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list/> <list>
<string>default</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -50,6 +52,10 @@ ...@@ -50,6 +52,10 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -69,6 +75,10 @@ ...@@ -69,6 +75,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_password</string> </value> <value> <string>my_password</string> </value>
......
3 5
\ No newline at end of file \ No newline at end of file
...@@ -62,20 +62,12 @@ if bt5 is None:\n ...@@ -62,20 +62,12 @@ if bt5 is None:\n
\n \n
active_result = ActiveResult()\n active_result = ActiveResult()\n
\n \n
template_tool.updateRepositoryBusinessTemplateList(\n bt5_list = bt5.split()\n
template_tool.getRepositoryList())\n bt5_list.extend(template_tool.getInstalledBusinessTemplateTitleList())\n
\n \n
try:\n try:\n
bt5_list = [x[1] for x in template_tool.resolveBusinessTemplateListDependency(\n message_list = template_tool.upgradeSite(bt5_list, dry_run=True)\n
bt5.split(),\n severity = len(message_list)\n
newest_only=True)]\n
\n
bt5_list.extend([x.getTitle() for x in \\\n
template_tool.getUpdatedRepositoryBusinessTemplateList()])\n
\n
bt5_list = list(set(bt5_list))\n
severity = len(bt5_list)\n
\n
except BusinessTemplateUnknownError, error:\n except BusinessTemplateUnknownError, error:\n
severity = -1\n severity = -1\n
detail = str(error)\n detail = str(error)\n
...@@ -83,13 +75,13 @@ except BusinessTemplateUnknownError, error:\n ...@@ -83,13 +75,13 @@ except BusinessTemplateUnknownError, error:\n
if severity == -1:\n if severity == -1:\n
severity = 5\n severity = 5\n
summary = "Unable to resolve bt5 dependencies"\n summary = "Unable to resolve bt5 dependencies"\n
\n
elif severity == 0:\n elif severity == 0:\n
summary = "Nothing to do."\n summary = "Nothing to do."\n
detail = ""\n detail = ""\n
else:\n else:\n
summary = "Upgrade needed"\n summary = "Upgrade needed."\n
detail = "Needed to install %s" % \', \'.join(bt5_list)\n detail = "Information: %s" % ",".join(message_list)\n
\n
\n \n
active_result.edit(\n active_result.edit(\n
summary=summary, \n summary=summary, \n
......
...@@ -56,12 +56,9 @@ bt5 = portal.getPromiseParameter(\'portal_templates\', \'expected_bt5\')\n ...@@ -56,12 +56,9 @@ bt5 = portal.getPromiseParameter(\'portal_templates\', \'expected_bt5\')\n
if bt5 is None:\n if bt5 is None:\n
return\n return\n
\n \n
bt5_list = [x[1] for x in portal.portal_templates.resolveBusinessTemplateListDependency(bt5.split(), newest_only=True)]\n bt5_list = bt5.split()\n
bt5_list.extend([x.getTitle() for x in portal.portal_templates.getUpdatedRepositoryBusinessTemplateList()])\n bt5_list.extend(portal.portal_templates.getInstalledBusinessTemplateTitleList())\n
bt5_list = list(set(bt5_list))\n portal.portal_templates.upgradeSite(bt5_list)\n
\n
portal.portal_templates.installBusinessTemplateListFromRepository(\n
bt5_list, activate=True, install_dependency=True)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
18 19
\ No newline at end of file \ No newline at end of file
...@@ -303,6 +303,7 @@ ...@@ -303,6 +303,7 @@
<string>my_view_mode_preferred_internal_use_list</string> <string>my_view_mode_preferred_internal_use_list</string>
<string>my_view_mode_listbox_read_only_effective_date</string> <string>my_view_mode_listbox_read_only_effective_date</string>
<string>my_view_mode_listbox_read_only_expiration_date</string> <string>my_view_mode_listbox_read_only_expiration_date</string>
<string>my_view_mode_preferred_tax_use_list</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_preferred_tax_use_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Tax Uses</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(here.portal_categories.use, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(base=1, local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<string>my_preferred_supplier_role_list</string> <string>my_preferred_supplier_role_list</string>
<string>my_preferred_client_role_list</string> <string>my_preferred_client_role_list</string>
<string>my_preferred_trade_base_amount_list</string> <string>my_preferred_trade_base_amount_list</string>
<string>my_preferred_tax_use_list</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_tax_use_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_preferred_tax_use_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<string>my_title</string> <string>my_title</string>
<string>my_role_name_list</string> <string>my_role_name_list</string>
<string>my_condition</string> <string>my_condition</string>
<string>my_local_roles_group_id</string> <string>my_local_role_group</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -71,6 +71,7 @@ if len(uids) == 0:\n ...@@ -71,6 +71,7 @@ if len(uids) == 0:\n
id_list = []\n id_list = []\n
portal_status_message = \'\'\n portal_status_message = \'\'\n
current_uid_list=[]\n current_uid_list=[]\n
installed_business_template_title_list = context.getInstalledBusinessTemplateTitleList()\n
for uid in uids:\n for uid in uids:\n
current_uid_list.append(uid)\n current_uid_list.append(uid)\n
repository, id = context.decodeRepositoryBusinessTemplateUid(uid)\n repository, id = context.decodeRepositoryBusinessTemplateUid(uid)\n
...@@ -79,8 +80,11 @@ for uid in uids:\n ...@@ -79,8 +80,11 @@ for uid in uids:\n
# Check for missing dependencies\n # Check for missing dependencies\n
for uid in uids:\n for uid in uids:\n
repository, id = context.decodeRepositoryBusinessTemplateUid(uid)\n repository, id = context.decodeRepositoryBusinessTemplateUid(uid)\n
dependency_list = context.getDependencyList((repository, id));\n dependency_list = context.getDependencyList((repository, id))\n
for dep_repository, dep_id in dependency_list:\n for dep_repository, dep_id in dependency_list:\n
if dep_id != id and \\\n
dep_id in installed_business_template_title_list:\n
continue\n
if dep_id not in id_list:\n if dep_id not in id_list:\n
id_list.append(dep_id)\n id_list.append(dep_id)\n
if dep_repository != \'meta\':\n if dep_repository != \'meta\':\n
......
41047 41048
\ No newline at end of file \ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/lines</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Uses of taxes</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preferred_tax_use_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: []</string> </value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value> <string>Manage properties</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -94,15 +94,10 @@ for f in form.get_fields():\n ...@@ -94,15 +94,10 @@ for f in form.get_fields():\n
listbox = request.get(\'listbox\') # XXX: hardcoded field name\n listbox = request.get(\'listbox\') # XXX: hardcoded field name\n
if listbox is not None:\n if listbox is not None:\n
listbox_line_list = []\n listbox_line_list = []\n
listbox = getattr(request,\'listbox\',None) # XXX: hardcoded field name\n for key, value in sorted(listbox.iteritems()):\n
listbox_keys = listbox.keys()\n value[\'listbox_key\'] = key\n
listbox_keys.sort()\n listbox_line_list.append(value)\n
for key in listbox_keys:\n doaction_param_list[\'listbox\'] = tuple(listbox_line_list)\n
listbox_line = listbox[key]\n
listbox_line[\'listbox_key\'] = key\n
listbox_line_list.append(listbox[key])\n
listbox_line_list = tuple(listbox_line_list)\n
doaction_param_list[\'listbox\'] = listbox_line_list # XXX: hardcoded field name\n
\n \n
try:\n try:\n
context.portal_workflow.doActionFor(\n context.portal_workflow.doActionFor(\n
...@@ -123,10 +118,11 @@ except ValidationFailed, error_message:\n ...@@ -123,10 +118,11 @@ except ValidationFailed, error_message:\n
# that would become an error.\n # that would become an error.\n
log("Status message has been truncated")\n log("Status message has been truncated")\n
message = "%s ..." % message[:(2000 - 4)]\n message = "%s ..." % message[:(2000 - 4)]\n
return context.Base_redirect(form_id,\n else:\n
keep_items={\'portal_status_message\': message}, **kw)\n message = request.get(\'portal_status_message\')\n
\n if message is None:\n
portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n message = translateString(\'Status changed.\')\n
kw.clear() # useful ?\n
\n \n
# Allow to redirect to another document\n # Allow to redirect to another document\n
redirect_document_path = request.get(\'redirect_document_path\', None)\n redirect_document_path = request.get(\'redirect_document_path\', None)\n
...@@ -137,7 +133,7 @@ else:\n ...@@ -137,7 +133,7 @@ else:\n
redirect_document = context\n redirect_document = context\n
\n \n
return redirect_document.Base_redirect(form_id,\n return redirect_document.Base_redirect(form_id,\n
keep_items={\'portal_status_message\': portal_status_message})\n keep_items={\'portal_status_message\': message}, **kw)\n
]]></string> </value> ]]></string> </value>
......
...@@ -425,11 +425,15 @@ div.listbox-content-fixed-width{\n ...@@ -425,11 +425,15 @@ div.listbox-content-fixed-width{\n
}\n }\n
\n \n
table.listbox td.listbox-table-no-result-row{\n table.listbox td.listbox-table-no-result-row{\n
background-color:#DAE6F6;\n
color:#001730;\n
border: 1px solid #3D6474;\n border: 1px solid #3D6474;\n
text-align:center;\n text-align:center;\n
}\n }\n
\n \n
table.listbox tr.listbox-stat-line{\n table.listbox tr.listbox-stat-line{\n
background-color:#C1DAEB;\n
color:#001730;\n
border-top: 1px solid #3D6474;\n border-top: 1px solid #3D6474;\n
}\n }\n
\n \n
......
2012-10-16 arnaud.fontaine
* Fix background color of stat and no cell ListBox lines.
2012-08-07 Kazuhiko 2012-08-07 Kazuhiko
* update FCKeditor to 2.6.8. * update FCKeditor to 2.6.8.
......
1085 1086
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2010 Nexedi SA and Contributors. # Copyright (c) 2010 Nexedi SA and Contributors.
...@@ -148,6 +149,10 @@ class TestERP5Discussion(ERP5TypeTestCase): ...@@ -148,6 +149,10 @@ class TestERP5Discussion(ERP5TypeTestCase):
self.assertSameSet([], web_section2.getDocumentValueList()) self.assertSameSet([], web_section2.getDocumentValueList())
def test_02_ReferenceGenerationFromString(self):
s = "a test by ivan !@#$%^&*()[]\\é"
self.assertEqual('a-test-by-ivan', self.portal.Base_generateReferenceFromString(s))
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Discussion)) suite.addTest(unittest.makeSuite(TestERP5Discussion))
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
Tests invoice creation from simulation. Tests invoice creation from simulation.
""" """
import sys, zipfile, xml.dom.minidom
import StringIO
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload, DummyMailHost from Products.ERP5Type.tests.utils import FileUpload, DummyMailHost
...@@ -1574,12 +1576,15 @@ class TestInvoice(TestInvoiceMixin): ...@@ -1574,12 +1576,15 @@ class TestInvoice(TestInvoiceMixin):
self.assertEquals(DateTime(2002, 03, 04), self.assertEquals(DateTime(2002, 03, 04),
invoice_transaction_movement.getStopDate()) invoice_transaction_movement.getStopDate())
def test_Invoice_viewAsODT(self): def test_Invoice_viewAsODT(self):
resource = self.portal.getDefaultModule( resource = self.portal.getDefaultModule(
self.resource_portal_type).newContent( self.resource_portal_type).newContent(
portal_type=self.resource_portal_type, portal_type=self.resource_portal_type,
title='Resource',) title='Resource',)
resource_tax = self.portal.getDefaultModule(
self.resource_portal_type).newContent(
portal_type=self.resource_portal_type,
title='Resource Tax',)
client = self.portal.organisation_module.newContent( client = self.portal.organisation_module.newContent(
portal_type='Organisation', title='Client') portal_type='Organisation', title='Client')
vendor = self.portal.organisation_module.newContent( vendor = self.portal.organisation_module.newContent(
...@@ -1593,14 +1598,78 @@ class TestInvoice(TestInvoiceMixin): ...@@ -1593,14 +1598,78 @@ class TestInvoice(TestInvoiceMixin):
source_section_value=vendor, source_section_value=vendor,
destination_value=client, destination_value=client,
destination_section_value=client) destination_section_value=client)
line = invoice.newContent(portal_type=self.invoice_line_portal_type, product_line1 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource, resource_value=resource,
quantity=10, quantity=10,
base_contribution='tax1',
price=3) price=3)
product_line2 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource,
quantity=20,
base_contribution='tax1',
price=5)
product_line3 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource,
quantity=60,
base_contribution='tax2',
price=5)
product_line4 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource,
quantity=60,
price=3)
product_line5 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource,
quantity=7,
price=20)
tax_line1 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource_tax,
use='trade/tax',
base_contribution='tax1',
quantity=130,
price=0.2)
tax_line2 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource_tax,
use='trade/tax',
base_contribution='tax2',
quantity=300,
price=0.05)
tax_line3 = invoice.newContent(portal_type=self.invoice_line_portal_type,
resource_value=resource_tax,
use='trade/tax',
base_contribution='tax3',
quantity=20,
price=0.1)
invoice.confirm() invoice.confirm()
self.tic() self.tic()
odt = invoice.Invoice_viewAsODT() odt = invoice.Invoice_viewAsODT()
import cStringIO
output = cStringIO.StringIO()
output.write(odt)
m = OpenDocumentTextFile(output)
text_content=m.toString().encode('ascii','replace')
if text_content.find('Resource Tax') != -1 :
self.fail('fail to delete the vat line in product line')
if text_content.find('Vat Code') == -1 :
self.fail('fail to add the vat code')
if text_content.find('Amount') == -1 :
self.fail('fail to add the amount for each tax')
if text_content.find('Rate') == -1 :
self.fail('fail to add the Rate for each tax')
tax1_product_total_price=str(10*3+20*5)
if text_content.find(tax1_product_total_price) == -1 :
self.fail('fail to get the total price of products which tax1')
tax2_product_total_price=str(60*5)
if text_content.find(tax2_product_total_price) == -1 :
self.fail('fail to get the total price of products which tax2')
no_tax_product_total_price=str(60*3+7*20)
if text_content.find(no_tax_product_total_price) == -1 :
self.fail('fail to get the total price of products which have no tax')
product_total_price_no_tax=str(10*3+20*5+60*5+60*3+7*20)
if text_content.find(product_total_price_no_tax) == -1 :
self.fail('fail to get the total price of the products without tax')
product_total_price=str(10*3+20*5+60*5+60*3+7*20+130*0.2+300*0.05+20*0.1)
if text_content.find(product_total_price) == -1 :
self.fail('fail to get the total price of the products with tax')
from Products.ERP5OOo.tests.utils import Validator from Products.ERP5OOo.tests.utils import Validator
odf_validator = Validator() odf_validator = Validator()
err_list = odf_validator.validate(odt) err_list = odf_validator.validate(odt)
...@@ -3502,6 +3571,28 @@ class TestPurchaseInvoice(TestInvoice, ERP5TypeTestCase): ...@@ -3502,6 +3571,28 @@ class TestPurchaseInvoice(TestInvoice, ERP5TypeTestCase):
stepTic stepTic
""" """
class OpenDocumentTextFile :
def __init__ (self, filelikeobj) :
zip = zipfile.ZipFile(filelikeobj)
self.content = xml.dom.minidom.parseString(zip.read("content.xml"))
def toString (self) :
""" Converts the document to a string. """
buffer = u""
for val in ["text:p", "text:h", "text:list"]:
for paragraph in self.content.getElementsByTagName(val) :
buffer += self.textToString(paragraph) + "\n"
return buffer
def textToString(self, element) :
buffer = u""
for node in element.childNodes :
if node.nodeType == xml.dom.Node.TEXT_NODE :
buffer += node.nodeValue
elif node.nodeType == xml.dom.Node.ELEMENT_NODE :
buffer += self.textToString(node)
return buffer
import unittest import unittest
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
This diff is collapsed.
...@@ -27,13 +27,10 @@ ...@@ -27,13 +27,10 @@
# #
############################################################################## ##############################################################################
import time
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Globals import PersistentMapping from Globals import PersistentMapping
from Acquisition import aq_base from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from zLOG import LOG, INFO
from cStringIO import StringIO
from Products.ERP5Configurator.Tool.ConfiguratorTool import _validateFormToRequest from Products.ERP5Configurator.Tool.ConfiguratorTool import _validateFormToRequest
from Products.ERP5.Document.Item import Item from Products.ERP5.Document.Item import Item
...@@ -262,19 +259,6 @@ class BusinessConfiguration(Item): ...@@ -262,19 +259,6 @@ class BusinessConfiguration(Item):
form = getattr(self, self.getNextTransition().getTransitionFormId()) form = getattr(self, self.getNextTransition().getTransitionFormId())
return _validateFormToRequest(form, REQUEST, **kw) return _validateFormToRequest(form, REQUEST, **kw)
#############
## misc ##
#############
security.declarePrivate('_getConfigurationStack')
def _getConfigurationStack(self):
""" Return list of created by client configuration save objects
sort on id which is an integer. """
result = self.objectValues('ERP5 Configuration Save')
result = map(None, result)
result.sort(lambda x, y: cmp(x.getIntIndex(x.getIntId()),
y.getIntIndex(y.getIntId())))
return result
security.declarePrivate('_getConfSaveForStateFromWorkflowHistory') security.declarePrivate('_getConfSaveForStateFromWorkflowHistory')
def _getConfSaveForStateFromWorkflowHistory(self): def _getConfSaveForStateFromWorkflowHistory(self):
""" Get from workflow history configuration save for this state """ """ Get from workflow history configuration save for this state """
...@@ -282,8 +266,7 @@ class BusinessConfiguration(Item): ...@@ -282,8 +266,7 @@ class BusinessConfiguration(Item):
current_state = self.getCurrentStateValue() current_state = self.getCurrentStateValue()
transition = self.getNextTransition() transition = self.getNextTransition()
next_state = self.unrestrictedTraverse(transition.getDestination()) next_state = self.unrestrictedTraverse(transition.getDestination())
workflow_history = current_state.getWorkflowHistory(self) for wh in current_state.getWorkflowHistory(self):
for wh in workflow_history:
if next_state == self.unrestrictedTraverse(wh['current_state']): if next_state == self.unrestrictedTraverse(wh['current_state']):
configuration_save = self.unrestrictedTraverse(wh['configuration_save_url']) configuration_save = self.unrestrictedTraverse(wh['configuration_save_url'])
return configuration_save return configuration_save
...@@ -339,12 +322,11 @@ class BusinessConfiguration(Item): ...@@ -339,12 +322,11 @@ class BusinessConfiguration(Item):
security.declareProtected(Permissions.View, 'getGlobalConfigurationAttr') security.declareProtected(Permissions.View, 'getGlobalConfigurationAttr')
def getGlobalConfigurationAttr(self, key, default=None): def getGlobalConfigurationAttr(self, key, default=None):
""" Get global business configuration attribute. """ """ Get global business configuration attribute. """
global_configuration_attributes = getattr(self, '_global_configuration_attributes', {}) return getattr(self, '_global_configuration_attributes', {}).get(key, default)
return global_configuration_attributes.get(key, default)
############# Instance and Business Configuration ######################## ############# Instance and Business Configuration ########################
security.declareProtected(Permissions.ModifyPortalContent, 'buildConfiguration') security.declareProtected(Permissions.ModifyPortalContent, 'buildConfiguration')
def buildConfiguration(self, execute_after_setup_script=1): def buildConfiguration(self):
""" """
Build list of business templates according to already saved Build list of business templates according to already saved
Configuration Saves (i.e. user input). Configuration Saves (i.e. user input).
...@@ -355,13 +337,13 @@ class BusinessConfiguration(Item): ...@@ -355,13 +337,13 @@ class BusinessConfiguration(Item):
after_method_id=["updateBusinessTemplateFromUrl", after_method_id=["updateBusinessTemplateFromUrl",
"recursiveImmediateReindexObject", "recursiveImmediateReindexObject",
"immediateReindexObject"]) "immediateReindexObject"])
start = time.time()
LOG("CONFIGURATOR", INFO,
'Build process started for %s' % self.getRelativeUrl())
# build # build
for configuration_save in self._getConfigurationStack(): configuration_save_list = self.contentValues(portal_type='Configuration Save')
configuration_save_list.sort(lambda x, y: cmp(x.getIntIndex(x.getIntId()),
y.getIntIndex(y.getIntId())))
for configuration_save in configuration_save_list:
# XXX: check which items are configure-able # XXX: check which items are configure-able
configuration_item_list = [x for x in configuration_save.contentValues()] configuration_item_list = configuration_save.contentValues()
configuration_item_list.sort(lambda x, y: cmp(x.getIntId(), y.getIntId())) configuration_item_list.sort(lambda x, y: cmp(x.getIntId(), y.getIntId()))
for configurator_item in configuration_item_list: for configurator_item in configuration_item_list:
configurator_item.activate(**kw).build(self.getRelativeUrl()) configurator_item.activate(**kw).build(self.getRelativeUrl())
...@@ -369,16 +351,11 @@ class BusinessConfiguration(Item): ...@@ -369,16 +351,11 @@ class BusinessConfiguration(Item):
kw["tag"] = "configurator_item_%s_%s" % (configurator_item.getId(), kw["tag"] = "configurator_item_%s_%s" % (configurator_item.getId(),
configurator_item.getUid()) configurator_item.getUid())
LOG('CONFIGURATOR', INFO, kw["tag"] = "final_configuration_step_%s" % self.getId()
'Build process started for %s ended after %.02fs' % (self.getRelativeUrl(), kw["after_method_id"] = ["build", 'immediateReindexObject', \
time.time() - start)) "recursiveImmediateReindexObject"]
if execute_after_setup_script:
kw["tag"] = "final_configuration_step_%s" % self.getId()
kw["after_method_id"] = ["build", 'immediateReindexObject', \
"recursiveImmediateReindexObject"]
self.activate(**kw).ERP5Site_afterConfigurationSetup() self.activate(**kw).ERP5Site_afterConfigurationSetup()
if self.portal_workflow.isTransitionPossible(self, 'install'): if self.portal_workflow.isTransitionPossible(self, 'install'):
self.activate(after_tag=kw["tag"]).install() self.activate(after_tag=kw["tag"]).install()
...@@ -113,7 +113,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase): ...@@ -113,7 +113,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
self.stepCleanUpRequest() self.stepCleanUpRequest()
self.restricted_security = 0 self.restricted_security = 0
self.setupAutomaticBusinessTemplateRepository() self.setupAutomaticBusinessTemplateRepository(
searchable_business_template_list=["erp5_core", "erp5_base"])
# it is required by SecurityTestCase # it is required by SecurityTestCase
self.workflow_tool = self.portal.portal_workflow self.workflow_tool = self.portal.portal_workflow
......
...@@ -83,16 +83,13 @@ class EditorWidget(Widget.TextAreaWidget): ...@@ -83,16 +83,13 @@ class EditorWidget(Widget.TextAreaWidget):
""" """
here = REQUEST['here'] here = REQUEST['here']
text_editor = field.get_value('text_editor') text_editor = field.get_value('text_editor')
if text_editor == 'text_area': if text_editor == 'bespin':
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
elif text_editor == 'bespin':
# XXX The usage of bespin editor depends of erp5_bespin bt5 # XXX The usage of bespin editor depends of erp5_bespin bt5
# installed and still experimental. If erp5_bespin is not installed, it # installed and still experimental. If erp5_bespin is not installed, it
# render standard an standard editor field. # render standard an standard editor field.
bespin_support = getattr(here, 'bespin_support',None) bespin_support = getattr(here, 'bespin_support',None)
if bespin_support is None: if bespin_support is not None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) return bespin_support.pt_render(
return bespin_support.pt_render(
extra_context= { extra_context= {
'field' : field, 'field' : field,
'inputvalue' : value, 'inputvalue' : value,
...@@ -100,9 +97,8 @@ class EditorWidget(Widget.TextAreaWidget): ...@@ -100,9 +97,8 @@ class EditorWidget(Widget.TextAreaWidget):
}) })
elif text_editor == "xinha": elif text_editor == "xinha":
xinha_support = getattr(here, 'xinha_support', None) xinha_support = getattr(here, 'xinha_support', None)
if xinha_support is None: if xinha_support is not None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) return xinha_support.pt_render(
return xinha_support.pt_render(
extra_context= { extra_context= {
'field' : field, 'field' : field,
'field_value' : value, 'field_value' : value,
...@@ -110,27 +106,25 @@ class EditorWidget(Widget.TextAreaWidget): ...@@ -110,27 +106,25 @@ class EditorWidget(Widget.TextAreaWidget):
}) })
elif text_editor == "svg_editor": elif text_editor == "svg_editor":
svg_editor_support = getattr(here, 'svg_editor_support', None) svg_editor_support = getattr(here, 'svg_editor_support', None)
if svg_editor_support is None: if svg_editor_support is not None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) return svg_editor_support.pt_render()
return svg_editor_support.pt_render()
elif text_editor == "spreadsheet_editor": elif text_editor == "spreadsheet_editor":
sheet_editor_support = getattr(here, 'sheet_editor_support', None) sheet_editor_support = getattr(here, 'sheet_editor_support', None)
if sheet_editor_support is None: if sheet_editor_support is not None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST) return sheet_editor_support.pt_render()
return sheet_editor_support.pt_render()
elif text_editor == 'ace': elif text_editor == 'ace':
ace_editor_support = getattr(here, 'ace_editor_support', None) ace_editor_support = getattr(here, 'ace_editor_support', None)
if ace_editor_support is None: if ace_editor_support is not None:
return Widget.TextAreaWidth.render(self, field, key, value, REQUEST) return ace_editor_support.pt_render(extra_context={'field': field,
return ace_editor_support.pt_render(extra_context={'field': field,
'content': value, 'content': value,
'id': key}) 'id': key})
else: elif text_editor != 'text_area':
return here.fckeditor_wysiwyg_support.pt_render( return here.fckeditor_wysiwyg_support.pt_render(
extra_context= { extra_context= {
'inputvalue' : value, 'inputvalue' : value,
'inputname' : key 'inputname' : key
}) })
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
def render_view(self, field, value, REQUEST=None, render_prefix=None): def render_view(self, field, value, REQUEST=None, render_prefix=None):
""" """
......
This diff is collapsed.
...@@ -64,6 +64,23 @@ class TestDocumentWithPreConversion(TestDocument): ...@@ -64,6 +64,23 @@ class TestDocumentWithPreConversion(TestDocument):
'Embedded-XXX?format=jpeg&display=large&quality=75'], 'Embedded-XXX?format=jpeg&display=large&quality=75'],
web_page.Base_extractImageUrlList()) web_page.Base_extractImageUrlList())
def test_Base_isConvertible(self):
"""
Test pre converion only happens on proper documents.
"""
print "da"
image = self.portal.image_module.newContent(portal_type='Image',
reference='Embedded-XXX',
version='001',
language='en')
# empty image is not convertible
self.assertEqual(False, image.Base_isConvertible())
# image with data is convertible
upload_file = makeFileUpload('cmyk_sample.jpg')
image.edit(file=upload_file)
self.tic()
self.assertEqual(True, image.Base_isConvertible())
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
...@@ -400,8 +400,7 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None): ...@@ -400,8 +400,7 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
sci = StateChangeInfo( sci = StateChangeInfo(
ob, self, status, tdef, old_sdef, new_sdef, kwargs) ob, self, status, tdef, old_sdef, new_sdef, kwargs)
# put the error message in the workflow history # put the error message in the workflow history
sci.setWorkflowVariable(ob, workflow_id=self.id, sci.setWorkflowVariable(error_message=before_script_error_message)
error_message = before_script_error_message)
if validation_exc : if validation_exc :
# reraise validation failed exception # reraise validation failed exception
raise validation_exc, None, validation_exc_traceback raise validation_exc, None, validation_exc_traceback
......
...@@ -30,19 +30,14 @@ from Products.DCWorkflow.Expression import StateChangeInfo ...@@ -30,19 +30,14 @@ from Products.DCWorkflow.Expression import StateChangeInfo
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
allow_class(StateChangeInfo) allow_class(StateChangeInfo)
def setWorkflowVariable(self, object, workflow_id='edit_workflow',**kw): def setWorkflowVariable(self, **kw):
""" """
Allows to go through security checking and let a Allows to go through security checking and let a
script allows to modify a workflow variable script allows to modify a workflow variable
""" """
workflow_history = object.workflow_history history = self.object.workflow_history[self.workflow.id]
for workflow in workflow_history.keys(): history[-1].update(kw)
if len(workflow_history[workflow])!= 0 and workflow==workflow_id: history._p_changed = 1
last_status = workflow_history[workflow][-1]
for variable in kw.keys():
if last_status.has_key(variable):
last_status[variable]=kw[variable]
StateChangeInfo.setWorkflowVariable = setWorkflowVariable StateChangeInfo.setWorkflowVariable = setWorkflowVariable
...@@ -570,7 +570,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): ...@@ -570,7 +570,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
public_bt5_repository_list) public_bt5_repository_list)
else: else:
self.portal.portal_templates.updateRepositoryBusinessTemplateList( self.portal.portal_templates.updateRepositoryBusinessTemplateList(
bt5_repository_path_list, None) bt5_repository_path_list, None)
elif accept_public: elif accept_public:
self.portal.portal_templates.updateRepositoryBusinessTemplateList( self.portal.portal_templates.updateRepositoryBusinessTemplateList(
public_bt5_repository_list) public_bt5_repository_list)
......
...@@ -608,7 +608,7 @@ def main(argument_list=None): ...@@ -608,7 +608,7 @@ def main(argument_list=None):
opts, args = getopt.getopt(sys.argv[1:], opts, args = getopt.getopt(sys.argv[1:],
"hpvD", ["help", "verbose", "profile", "coverage=", "portal_id=", "hpvD", ["help", "verbose", "profile", "coverage=", "portal_id=",
"data_fs_path=", "data_fs_path=",
"bt5_path", "bt5_path=",
"firefox_bin=", "firefox_bin=",
"xvfb_bin=", "xvfb_bin=",
"recreate_catalog=", "erp5_sql_connection_string=", "recreate_catalog=", "erp5_sql_connection_string=",
......
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