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
return tax_line_list\n
\n
\n
\n
line_base_contribution_list = []\n
number = 0\n
line_novat_totalprice = 0\n
line_list = []\n
line_not_vat = []\n
line_vat = []\n
line_not_vat_has_no_vat = {}\n
total_price = 0.0\n
total_vat = 0.0\n
total_vat_price = 0.0\n
vat_total_list = []\n
taxnumber = 0\n
taxname = \'\'\n
\n
def unicodeDict(d):\n
for k, v in d.items():\n
......@@ -176,8 +187,23 @@ for line in getSubLineList(context):\n
display_id = \'translated_title\'\n
if request.get(\'international_form\'):\n
display_id = \'title\'\n
desc = (\', \'.join([x[0] for x in\n
line.getVariationCategoryItemList(display_id=display_id)]),)\n
desc = (\', \'.join([x[0] for x in 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
\'style_name\': \'Table_20_Contents\',\n
\'left_style_name\': \'Table_20_Contents_20_Left\',\n
......@@ -187,16 +213,44 @@ for line in getSubLineList(context):\n
\'reference\': line.getResource() is not None\\\n
and line.getResourceValue().getReference() or \'\',\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
\'tax_name\':taxname or \'\',\n
\'tax_number\':taxnumber or \'\',\n
\'quantity_unit\': line.getQuantityUnitTranslatedTitle() or (\n
line.getResource() and line.getResourceValue().getQuantityUnitTranslatedTitle()) or \'\',\n
\'stop_date\': getOrderedDate(line.getStopDate()) 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
}\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
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
inch_cm_ratio = 2.54 / 100.0\n
\n
......@@ -397,11 +451,15 @@ data_dict = {\n
\'delivery_mode\': context.getDeliveryModeTranslatedTitle() or \'\',\n
\'incoterm\': context.getIncoterm() and context.getIncotermValue().getCodification() or \'\',\n
\n
\'vat_name_list\':line_base_contribution_list,\n
\'total_price\':total_price+total_vat_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
\'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
}\n
\n
......
......@@ -211,7 +211,8 @@ system_prefs = dict(\n
preferred_client_role_list = [\'client\'],\n
preferred_sale_use_list = [\'trade/sale\'],\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
configuration_save.addConfigurationItem(\n
\'System Preference Configurator Item\',\n
......
......@@ -367,6 +367,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
self.assertEquals(['trade/sale'], preference_tool.getPreferredSaleUseList())
self.assertEquals(['trade/purchase'], preference_tool.getPreferredPurchaseUseList())
self.assertEquals(['trade/container'], preference_tool.getPreferredPackingUseList())
self.assertEquals(['trade/tax']), preference_tool.getPreferredTaxUseList())
def stepCheckModulesBusinessApplication(self, sequence=None, sequence_list=None, **kw):
"""
......
......@@ -50,33 +50,37 @@
</item>
<item>
<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
def TestTitle(object):\n
"""\n
This is the test for this particular action\n
"""\n
if object.getTitle() == \'truc\':\n
return 1\n
return 0\n
def removeNonAscii(s): \n
return "".join(i for i in s if ord(i)>44 and ord(i)<123)\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
if TestTitle(object):\n
method = getattr(context, transition)\n
method()\n
else:\n
kw = {\'error_message\':\'Why do you want to do this ?????\'}\n
state_change.setWorkflowVariable(object, **kw)\n
</string> </value>
s = removeNonAscii(s)\n
for item in transliterate_list:\n
s = s.replace(item, \'-\')\n
\n
return s.strip(\'-\')\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string>s</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_error_message</string> </value>
<value> <string>Base_generateReferenceFromString</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -59,7 +59,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>left reply-dialog</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
......@@ -90,7 +90,7 @@
</value>
</item>
<item>
<key> <string>left</string> </key>
<key> <string>left reply-dialog</string> </key>
<value>
<list>
<string>your_title</string>
......
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
<value> <string>"""\n
This script allows to create a new Discussion Thread.\n
"""\n
from zExceptions import Unauthorized\n
\n
MARKER = [\'\', None, []]\n
\n
portal = context.getPortalObject()\n
......@@ -62,7 +62,13 @@ person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
version = \'001\'\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
group_list = user_assignment_dict[\'group_list\']\n
if site_list in MARKER:\n
......@@ -72,7 +78,8 @@ if site_list in MARKER:\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n
reference = title.replace(\' \', \'-\').replace(\'?\', \'\').replace(\':\', \'\').replace(\'/\', \'\').replace(\'&\', \'\').replace(\'=\', \'\')\n
reference = context.Base_generateReferenceFromString(title)\n
\n
existing_document = context.getDocumentValue(reference)\n
if existing_document is not None:\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
\n
return context.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
]]></string> </value>
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
......@@ -59,7 +59,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>left reply-dialog</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
......@@ -90,7 +90,7 @@
</value>
</item>
<item>
<key> <string>left</string> </key>
<key> <string>left reply-dialog</string> </key>
<value>
<list>
<string>your_title</string>
......
119
\ No newline at end of file
122
\ No newline at end of file
......@@ -62,10 +62,7 @@ if address not in MARKER and port not in MARKER:\n
for index_uid in range(len(uid)):\n
document_relative_url = getRelativeUrl[index_uid]\n
document = portal.restrictedTraverse(document_relative_url)\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
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
if document.Base_isConvertible():\n
document.activate(priority=4, tag="conversion").Base_callPreConvert()\n
</string> </value>
</item>
......
......@@ -56,11 +56,8 @@
"""\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
# no need to convert any non DMS types\n
if not context.Base_isConvertible():\n
# no need to convert any non convertible types\n
return\n
\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 @@
portal = context.getPortalObject()\n
\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
\'shared\', \'shared_alive\', \'public\', \'validated\')\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 "関連する出荷明細書がありません"
msgid "No Trade Condition."
msgstr "取引条件がありません。"
msgid "No result !"
msgstr "見つかれませんでした!"
msgid "No result."
msgstr "見つかれませんでした。"
msgid "No such document was found."
msgstr "ドキュメントが見つかりませんでした。"
......
2012-10-16 arnaud.fontaine
* Add missing translations for 'No result.' and 'No result !'.
2010-07-09 tatuya
* Fix the translations of Internal Packing List. Because they were not consistent.
......
39
\ No newline at end of file
40
\ No newline at end of file
......@@ -65,7 +65,6 @@ class PaypalService(XMLObject):
def navigate(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation"""
self.Base_checkConsistency()
page_template = kw.pop("page_template")
paypal_dict = kw.get("paypal_dict", {})
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 @@
<string>my_title</string>
<string>my_reference</string>
<string>my_link_url_string</string>
<string>my_nvp_link</string>
</list>
</value>
</item>
......@@ -110,6 +111,7 @@
<string>my_service_username</string>
<string>my_service_password</string>
<string>my_service_signature</string>
<string>my_service_email</string>
</list>
</value>
</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 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
<list>
<string>default</string>
</list>
</value>
</item>
<item>
......@@ -50,6 +52,10 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,6 +75,10 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_password</string> </value>
......
3
\ No newline at end of file
5
\ No newline at end of file
......@@ -62,20 +62,12 @@ if bt5 is None:\n
\n
active_result = ActiveResult()\n
\n
template_tool.updateRepositoryBusinessTemplateList(\n
template_tool.getRepositoryList())\n
bt5_list = bt5.split()\n
bt5_list.extend(template_tool.getInstalledBusinessTemplateTitleList())\n
\n
try:\n
bt5_list = [x[1] for x in template_tool.resolveBusinessTemplateListDependency(\n
bt5.split(),\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
message_list = template_tool.upgradeSite(bt5_list, dry_run=True)\n
severity = len(message_list)\n
except BusinessTemplateUnknownError, error:\n
severity = -1\n
detail = str(error)\n
......@@ -83,13 +75,13 @@ except BusinessTemplateUnknownError, error:\n
if severity == -1:\n
severity = 5\n
summary = "Unable to resolve bt5 dependencies"\n
\n
elif severity == 0:\n
summary = "Nothing to do."\n
detail = ""\n
else:\n
summary = "Upgrade needed"\n
detail = "Needed to install %s" % \', \'.join(bt5_list)\n
summary = "Upgrade needed."\n
detail = "Information: %s" % ",".join(message_list)\n
\n
\n
active_result.edit(\n
summary=summary, \n
......
......@@ -56,12 +56,9 @@ bt5 = portal.getPromiseParameter(\'portal_templates\', \'expected_bt5\')\n
if bt5 is None:\n
return\n
\n
bt5_list = [x[1] for x in portal.portal_templates.resolveBusinessTemplateListDependency(bt5.split(), newest_only=True)]\n
bt5_list.extend([x.getTitle() for x in portal.portal_templates.getUpdatedRepositoryBusinessTemplateList()])\n
bt5_list = list(set(bt5_list))\n
\n
portal.portal_templates.installBusinessTemplateListFromRepository(\n
bt5_list, activate=True, install_dependency=True)\n
bt5_list = bt5.split()\n
bt5_list.extend(portal.portal_templates.getInstalledBusinessTemplateTitleList())\n
portal.portal_templates.upgradeSite(bt5_list)\n
</string> </value>
</item>
<item>
......
18
\ No newline at end of file
19
\ No newline at end of file
......@@ -303,6 +303,7 @@
<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_expiration_date</string>
<string>my_view_mode_preferred_tax_use_list</string>
</list>
</value>
</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 @@
<string>my_preferred_supplier_role_list</string>
<string>my_preferred_client_role_list</string>
<string>my_preferred_trade_base_amount_list</string>
<string>my_preferred_tax_use_list</string>
</list>
</value>
</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 @@
<string>my_title</string>
<string>my_role_name_list</string>
<string>my_condition</string>
<string>my_local_roles_group_id</string>
<string>my_local_role_group</string>
</list>
</value>
</item>
......
......@@ -71,6 +71,7 @@ if len(uids) == 0:\n
id_list = []\n
portal_status_message = \'\'\n
current_uid_list=[]\n
installed_business_template_title_list = context.getInstalledBusinessTemplateTitleList()\n
for uid in uids:\n
current_uid_list.append(uid)\n
repository, id = context.decodeRepositoryBusinessTemplateUid(uid)\n
......@@ -79,8 +80,11 @@ for uid in uids:\n
# Check for missing dependencies\n
for uid in uids:\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
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
id_list.append(dep_id)\n
if dep_repository != \'meta\':\n
......
41047
\ No newline at end of file
41048
\ 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
listbox = request.get(\'listbox\') # XXX: hardcoded field name\n
if listbox is not None:\n
listbox_line_list = []\n
listbox = getattr(request,\'listbox\',None) # XXX: hardcoded field name\n
listbox_keys = listbox.keys()\n
listbox_keys.sort()\n
for key in listbox_keys:\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
for key, value in sorted(listbox.iteritems()):\n
value[\'listbox_key\'] = key\n
listbox_line_list.append(value)\n
doaction_param_list[\'listbox\'] = tuple(listbox_line_list)\n
\n
try:\n
context.portal_workflow.doActionFor(\n
......@@ -123,10 +118,11 @@ except ValidationFailed, error_message:\n
# that would become an error.\n
log("Status message has been truncated")\n
message = "%s ..." % message[:(2000 - 4)]\n
return context.Base_redirect(form_id,\n
keep_items={\'portal_status_message\': message}, **kw)\n
\n
portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n
else:\n
message = request.get(\'portal_status_message\')\n
if message is None:\n
message = translateString(\'Status changed.\')\n
kw.clear() # useful ?\n
\n
# Allow to redirect to another document\n
redirect_document_path = request.get(\'redirect_document_path\', None)\n
......@@ -137,7 +133,7 @@ else:\n
redirect_document = context\n
\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>
......
......@@ -425,11 +425,15 @@ div.listbox-content-fixed-width{\n
}\n
\n
table.listbox td.listbox-table-no-result-row{\n
background-color:#DAE6F6;\n
color:#001730;\n
border: 1px solid #3D6474;\n
text-align:center;\n
}\n
\n
table.listbox tr.listbox-stat-line{\n
background-color:#C1DAEB;\n
color:#001730;\n
border-top: 1px solid #3D6474;\n
}\n
\n
......
2012-10-16 arnaud.fontaine
* Fix background color of stat and no cell ListBox lines.
2012-08-07 Kazuhiko
* update FCKeditor to 2.6.8.
......
1085
\ No newline at end of file
1086
\ No newline at end of file
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Nexedi SA and Contributors.
......@@ -148,6 +149,10 @@ class TestERP5Discussion(ERP5TypeTestCase):
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():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Discussion))
......
......@@ -30,6 +30,8 @@
Tests invoice creation from simulation.
"""
import sys, zipfile, xml.dom.minidom
import StringIO
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload, DummyMailHost
......@@ -1574,12 +1576,15 @@ class TestInvoice(TestInvoiceMixin):
self.assertEquals(DateTime(2002, 03, 04),
invoice_transaction_movement.getStopDate())
def test_Invoice_viewAsODT(self):
resource = self.portal.getDefaultModule(
self.resource_portal_type).newContent(
portal_type=self.resource_portal_type,
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(
portal_type='Organisation', title='Client')
vendor = self.portal.organisation_module.newContent(
......@@ -1593,14 +1598,78 @@ class TestInvoice(TestInvoiceMixin):
source_section_value=vendor,
destination_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,
quantity=10,
base_contribution='tax1',
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()
self.tic()
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
odf_validator = Validator()
err_list = odf_validator.validate(odt)
......@@ -3502,6 +3571,28 @@ class TestPurchaseInvoice(TestInvoice, ERP5TypeTestCase):
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
def test_suite():
suite = unittest.TestSuite()
......
This diff is collapsed.
......@@ -27,13 +27,10 @@
#
##############################################################################
import time
from AccessControl import ClassSecurityInfo
from Globals import PersistentMapping
from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet
from zLOG import LOG, INFO
from cStringIO import StringIO
from Products.ERP5Configurator.Tool.ConfiguratorTool import _validateFormToRequest
from Products.ERP5.Document.Item import Item
......@@ -262,19 +259,6 @@ class BusinessConfiguration(Item):
form = getattr(self, self.getNextTransition().getTransitionFormId())
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')
def _getConfSaveForStateFromWorkflowHistory(self):
""" Get from workflow history configuration save for this state """
......@@ -282,8 +266,7 @@ class BusinessConfiguration(Item):
current_state = self.getCurrentStateValue()
transition = self.getNextTransition()
next_state = self.unrestrictedTraverse(transition.getDestination())
workflow_history = current_state.getWorkflowHistory(self)
for wh in workflow_history:
for wh in current_state.getWorkflowHistory(self):
if next_state == self.unrestrictedTraverse(wh['current_state']):
configuration_save = self.unrestrictedTraverse(wh['configuration_save_url'])
return configuration_save
......@@ -339,12 +322,11 @@ class BusinessConfiguration(Item):
security.declareProtected(Permissions.View, 'getGlobalConfigurationAttr')
def getGlobalConfigurationAttr(self, key, default=None):
""" Get global business configuration attribute. """
global_configuration_attributes = getattr(self, '_global_configuration_attributes', {})
return global_configuration_attributes.get(key, default)
return getattr(self, '_global_configuration_attributes', {}).get(key, default)
############# Instance and Business Configuration ########################
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
Configuration Saves (i.e. user input).
......@@ -355,13 +337,13 @@ class BusinessConfiguration(Item):
after_method_id=["updateBusinessTemplateFromUrl",
"recursiveImmediateReindexObject",
"immediateReindexObject"])
start = time.time()
LOG("CONFIGURATOR", INFO,
'Build process started for %s' % self.getRelativeUrl())
# 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
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()))
for configurator_item in configuration_item_list:
configurator_item.activate(**kw).build(self.getRelativeUrl())
......@@ -369,16 +351,11 @@ class BusinessConfiguration(Item):
kw["tag"] = "configurator_item_%s_%s" % (configurator_item.getId(),
configurator_item.getUid())
LOG('CONFIGURATOR', INFO,
'Build process started for %s ended after %.02fs' % (self.getRelativeUrl(),
time.time() - start))
if execute_after_setup_script:
kw["tag"] = "final_configuration_step_%s" % self.getId()
kw["after_method_id"] = ["build", 'immediateReindexObject', \
"recursiveImmediateReindexObject"]
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'):
self.activate(after_tag=kw["tag"]).install()
......@@ -113,7 +113,8 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
self.stepCleanUpRequest()
self.restricted_security = 0
self.setupAutomaticBusinessTemplateRepository()
self.setupAutomaticBusinessTemplateRepository(
searchable_business_template_list=["erp5_core", "erp5_base"])
# it is required by SecurityTestCase
self.workflow_tool = self.portal.portal_workflow
......
......@@ -83,16 +83,13 @@ class EditorWidget(Widget.TextAreaWidget):
"""
here = REQUEST['here']
text_editor = field.get_value('text_editor')
if text_editor == 'text_area':
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
elif text_editor == 'bespin':
if text_editor == 'bespin':
# XXX The usage of bespin editor depends of erp5_bespin bt5
# installed and still experimental. If erp5_bespin is not installed, it
# render standard an standard editor field.
bespin_support = getattr(here, 'bespin_support',None)
if bespin_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return bespin_support.pt_render(
if bespin_support is not None:
return bespin_support.pt_render(
extra_context= {
'field' : field,
'inputvalue' : value,
......@@ -100,9 +97,8 @@ class EditorWidget(Widget.TextAreaWidget):
})
elif text_editor == "xinha":
xinha_support = getattr(here, 'xinha_support', None)
if xinha_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return xinha_support.pt_render(
if xinha_support is not None:
return xinha_support.pt_render(
extra_context= {
'field' : field,
'field_value' : value,
......@@ -110,27 +106,25 @@ class EditorWidget(Widget.TextAreaWidget):
})
elif text_editor == "svg_editor":
svg_editor_support = getattr(here, 'svg_editor_support', None)
if svg_editor_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return svg_editor_support.pt_render()
if svg_editor_support is not None:
return svg_editor_support.pt_render()
elif text_editor == "spreadsheet_editor":
sheet_editor_support = getattr(here, 'sheet_editor_support', None)
if sheet_editor_support is None:
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
return sheet_editor_support.pt_render()
if sheet_editor_support is not None:
return sheet_editor_support.pt_render()
elif text_editor == 'ace':
ace_editor_support = getattr(here, 'ace_editor_support', None)
if ace_editor_support is None:
return Widget.TextAreaWidth.render(self, field, key, value, REQUEST)
return ace_editor_support.pt_render(extra_context={'field': field,
if ace_editor_support is not None:
return ace_editor_support.pt_render(extra_context={'field': field,
'content': value,
'id': key})
else:
elif text_editor != 'text_area':
return here.fckeditor_wysiwyg_support.pt_render(
extra_context= {
'inputvalue' : value,
'inputname' : key
})
return Widget.TextAreaWidget.render(self, field, key, value, REQUEST)
def render_view(self, field, value, REQUEST=None, render_prefix=None):
"""
......
This diff is collapsed.
......@@ -64,6 +64,23 @@ class TestDocumentWithPreConversion(TestDocument):
'Embedded-XXX?format=jpeg&display=large&quality=75'],
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():
suite = unittest.TestSuite()
......
......@@ -400,8 +400,7 @@ def DCWorkflowDefinition_executeTransition(self, ob, tdef=None, kwargs=None):
sci = StateChangeInfo(
ob, self, status, tdef, old_sdef, new_sdef, kwargs)
# put the error message in the workflow history
sci.setWorkflowVariable(ob, workflow_id=self.id,
error_message = before_script_error_message)
sci.setWorkflowVariable(error_message=before_script_error_message)
if validation_exc :
# reraise validation failed exception
raise validation_exc, None, validation_exc_traceback
......
......@@ -30,19 +30,14 @@ from Products.DCWorkflow.Expression import StateChangeInfo
from Products.PythonScripts.Utility import allow_class
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
script allows to modify a workflow variable
"""
workflow_history = object.workflow_history
for workflow in workflow_history.keys():
if len(workflow_history[workflow])!= 0 and workflow==workflow_id:
last_status = workflow_history[workflow][-1]
for variable in kw.keys():
if last_status.has_key(variable):
last_status[variable]=kw[variable]
history = self.object.workflow_history[self.workflow.id]
history[-1].update(kw)
history._p_changed = 1
StateChangeInfo.setWorkflowVariable = setWorkflowVariable
......@@ -570,7 +570,7 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
public_bt5_repository_list)
else:
self.portal.portal_templates.updateRepositoryBusinessTemplateList(
bt5_repository_path_list, None)
bt5_repository_path_list, None)
elif accept_public:
self.portal.portal_templates.updateRepositoryBusinessTemplateList(
public_bt5_repository_list)
......
......@@ -608,7 +608,7 @@ def main(argument_list=None):
opts, args = getopt.getopt(sys.argv[1:],
"hpvD", ["help", "verbose", "profile", "coverage=", "portal_id=",
"data_fs_path=",
"bt5_path",
"bt5_path=",
"firefox_bin=",
"xvfb_bin=",
"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