Commit e1d50308 authored by Julien Muchembled's avatar Julien Muchembled

Sync with trunk@34763

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@34770 20353a03-c40f-0410-a6d1-a30d3c3de9de
parents 5833251c 43fb24ec
......@@ -79,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAddAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -79,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAddAccountingTransactionLineDialog?portal_type=Accounting+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -79,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Purchase+Invoice+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAddAccountingTransactionLineDialog?portal_type=Purchase+Invoice+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -79,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/AccountingTransaction_viewAccountingTransactionLineDialog?portal_type=Sale+Invoice+Transaction+Line</string> </value>
<value> <string>string:${object_url}/AccountingTransaction_viewAddAccountingTransactionLineDialog?portal_type=Sale+Invoice+Transaction+Line</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -105,7 +105,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingTransaction_viewAccountingTransactionLineDialog</string> </value>
<value> <string>AccountingTransaction_viewAddAccountingTransactionLineDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -67,12 +67,14 @@ def getAccountingPeriodStartDateForSectionCategory(section_category, date):\n
section_uid.extend(portal.Base_getSectionUidListForSectionCategory(\n
section_category, strict_membership=False))\n
period_start_date = None\n
valid_accounting_period = dict(portal_type=\'Accounting Period\',\n
simulation_state=(\'planned\', \'confirmed\',\n
\'started\', \'stopped\', \'closing\', \'delivered\'))\n
for uid in section_uid:\n
section = portal.portal_catalog.getObject(uid)\n
for ap in section.contentValues(filter=valid_accounting_period):\n
for ap in section.contentValues(portal_type=\'Accounting Period\',\n
checked_permission=\'Access contents information\'):\n
if ap.getSimulationState() not in (\'planned\', \'confirmed\',\n
\'started\', \'stopped\',\n
\'closing\', \'delivered\'):\n
continue\n
if ap.getStartDate() <= date <= ap.getStopDate():\n
period_start_date = ap.getStartDate().earliestTime()\n
if period_start_date:\n
......
1190
\ No newline at end of file
1193
\ No newline at end of file
......@@ -96,6 +96,14 @@ return printed\n
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
......
97
\ No newline at end of file
98
\ No newline at end of file
......@@ -65,7 +65,6 @@ transaction.setResource(\'currency_module/\' + context.Baobab_getPortalReference
\n
movement = context.newContent(portal_type=\'Banking Operation Line\',\n
id=\'movement\',\n
immediate_reindex=1,\n
source=\'account_module/bank_account\', # Set default source\n
destination=\'account_module/bank_account\', # Set default destination\n
)\n
......
682
\ No newline at end of file
683
\ No newline at end of file
......@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -79,7 +81,7 @@
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${portal_url}/person_module/view?reset:int=1&subordination_uid=${object/getUid}
string:${object_url}/Base_jumpToRelatedObject?base_category=subordination&portal_type=Person
]]></string> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>"""Initialise int_index of object\n
"""\n
\n
parent = context.getParentValue()\n
portal_type = context.getPortalType()\n
\n
index = len(parent.contentValues(filter={"portal_type": portal_type}))\n
\n
context.edit(int_index=index)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>args</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>parent</string>
<string>portal_type</string>
<string>len</string>
<string>index</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_initIntIndex</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>message_list = []\n
\n
for m in context.getDivergenceList():\n
message_list.append(str(m.getTranslatedMessage()))\n
return \', \'.join(message_list)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>message_list</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>m</string>
<string>str</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getDivergenceListMessage</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -53,28 +53,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
# Get the career object and its parent\n
career_object = state_change[\'object\']\n
person_object = career_object.getParentValue()\n
\n
active_careers = []\n
\n
# Count the number of opened career\n
for career in person_object.contentValues(filter={\'portal_type\': \'Career\'}):\n
if career.getValidationState() == \'open\':\n
active_careers.append(career.getTitleOrId())\n
\n
# There is at least one open career, so we can\'t open a new one until the current one is inactive (closed or cancelled)\n
# XXX is this check really needed ?\n
if len(active_careers) > 0:\n
raise ValidationFailed, "Error : current active career (\'" + "\', \'".join(active_careers) + "\') must be inactive"\n
]]></string> </value>
<value> <string>state_change[\'object\'].Base_checkConsistency()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -111,16 +91,8 @@ if len(active_careers) > 0:\n
<value>
<tuple>
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getitem_</string>
<string>career_object</string>
<string>_getattr_</string>
<string>person_object</string>
<string>active_careers</string>
<string>_getiter_</string>
<string>career</string>
<string>len</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
......@@ -137,7 +109,7 @@ if len(active_careers) > 0:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Career_checkUniqueActiveCareer</string> </value>
<value> <string>Career_checkConsistency</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -45,23 +45,22 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
......@@ -80,6 +79,8 @@
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
......
......@@ -50,24 +50,23 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......@@ -77,6 +76,7 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
......@@ -87,7 +87,9 @@
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......
......@@ -45,7 +45,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>Career_checkUniqueActiveCareer</string> </value>
<value> <string>Career_checkConsistency</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
714
\ No newline at end of file
719
\ No newline at end of file
......@@ -80,18 +80,18 @@
.main_content h3 {font-size:120% !important; color:#FF0000;}\n
div.portal_status_message h3 {margin:0px;}\n
\n
#fieldset_left {padding:10px;}\n
#fieldset_left div.field {margin-top:5px; margin-bottom: 10px;}\n
#fieldset_left label {width: 135px !important; font-size: 120% !important; color:#505050; float:left; width: <tal:block tal:replace="python: main_content_width / 5"/>px;}\n
#fieldset_left label a {display:none;}\n
#fieldset_right {padding:10px;}\n
#fieldset_right div.field {margin-top:5px; margin-bottom: 10px;}\n
#fieldset_right label {width: 135px !important; font-size: 120% !important; color:#505050; float:left; width:<tal:block tal:replace="python: main_content_width / 5"/>px;}\n
#fieldset_right label a {display:none;}\n
#fieldset_center {padding:10px;}\n
#fieldset_center div.field {margin-top:5px; margin-bottom: 10px;}\n
#fieldset_center label {font-size: 120% !important; color:#505050; float:left; width:<tal:block tal:replace="python: main_content_width / 5"/>px;}\n
#fieldset_center label a {display:none;}\n
fieldset.left {padding:10px;}\n
fieldset.left div.field {margin-top:5px; margin-bottom: 10px;}\n
fieldset.left label {width: 135px !important; font-size: 120% !important; color:#505050; float:left; width: <tal:block tal:replace="python: main_content_width / 5"/>px;}\n
fieldset.left label a {display:none;}\n
fieldset.right {padding:10px;}\n
fieldset.right div.field {margin-top:5px; margin-bottom: 10px;}\n
fieldset.right label {width: 135px !important; font-size: 120% !important; color:#505050; float:left; width:<tal:block tal:replace="python: main_content_width / 5"/>px;}\n
fieldset.right label a {display:none;}\n
fieldset.center {padding:10px;}\n
fieldset.center div.field {margin-top:5px; margin-bottom: 10px;}\n
fieldset.center label {font-size: 120% !important; color:#505050; float:left; width:<tal:block tal:replace="python: main_content_width / 5"/>px;}\n
fieldset.center label a {display:none;}\n
\n
div.subcontent-box.cartbox fieldset.widget div.field label {display: none;}\n
div.subcontent-box.cartbox h1.group_title {background: url(./mf54_image/icon_celltitle_cart.png) no-repeat; background-position:229px 5px;}\n
......@@ -208,7 +208,8 @@ fieldset.editable div.input {padding:0px;}\n
.main_content table tr.shopping_cart_end_lines td.used {border-bottom:solid 1px #CCC;}\n
\n
\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
251
\ No newline at end of file
252
\ No newline at end of file
......@@ -105,7 +105,7 @@ return discussion_thread.Base_redirect(form_id,\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title, text_content, form_id, predecessor=None, description=None, subject_list=None, classification=None, group_list=None, site_list=None, reference=None,**kw</string> </value>
<value> <string>title, text_content, form_id=\'view\', predecessor=None, description=None, subject_list=None, classification=None, group_list=None, site_list=None, reference=None,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -174,6 +174,7 @@ return discussion_thread.Base_redirect(form_id,\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<string>view</string>
<none/>
<none/>
<none/>
......
......@@ -116,7 +116,7 @@ return context.Base_redirect(form_id,\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title, text_content, form_id, send_notification_text=None, predecessor=None,**kw</string> </value>
<value> <string>title, text_content, form_id=\'view\', send_notification_text=None, predecessor=None,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -195,6 +195,7 @@ return context.Base_redirect(form_id,\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<string>view</string>
<none/>
<none/>
</tuple>
......
......@@ -63,10 +63,9 @@
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
<string>bottom</string>
</list>
</value>
</item>
......@@ -102,12 +101,6 @@
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -16,6 +16,7 @@
<string>css_class</string>
<string>default</string>
<string>editable</string>
<string>enabled</string>
<string>title</string>
</list>
</value>
......@@ -72,6 +73,12 @@
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -107,6 +114,10 @@
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_editor_field</string> </value>
......@@ -149,4 +160,20 @@ python: \'<a class="bt-small" style="width:250px;" href="%s/discussion_thread_mo
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_checkPermission(\'discussion_thread_module\', \'Add portal content\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
43
\ No newline at end of file
45
\ No newline at end of file
......@@ -9,12 +9,33 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_dms</string> </value>
......
......@@ -13,9 +13,8 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
......@@ -69,12 +68,6 @@
<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>
......@@ -102,12 +95,6 @@
<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>
......@@ -122,20 +109,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_categories[field.getId().replace(\'my_\', \'\', 1).replace(\'_list\', \'\')].getCategoryChildTranslatedCompactLogicalPathItemList(display_none_category=1,local_sort_id="translated_short_title",checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -13,9 +13,8 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
......@@ -69,12 +68,6 @@
<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>
......@@ -94,10 +87,6 @@
<key> <string>description</string> </key>
<value> <string>A document can be associated to one or multiple entities in the group classification tree.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_category_list</string> </value>
......@@ -106,12 +95,6 @@
<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>
......@@ -126,20 +109,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_categories[field.getId().replace(\'my_\', \'\', 1).replace(\'_list\', \'\')].getCategoryChildCompactLogicalPathItemList(display_none_category=1,local_sort_id="compact_title",checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -13,9 +13,8 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
<string>description</string>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
......@@ -69,12 +68,6 @@
<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>
......@@ -94,10 +87,6 @@
<key> <string>description</string> </key>
<value> <string>A document can be associated to one or multiple entities in the site classification tree.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_category_list</string> </value>
......@@ -106,12 +95,6 @@
<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>
......@@ -126,20 +109,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_categories[field.getId().replace(\'my_\', \'\', 1).replace(\'_list\', \'\')].getCategoryChildCompactLogicalPathItemList(display_none_category=1,local_sort_id="compact_title",checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -44,9 +44,9 @@
python:here.PDF_getPageNumberFromSelectionIndex(request.get(\'selection_index\', 0));\n
display request/display|string:xlarge;\n
format request/format|string:png;">\n
<img src="" style="margin:0pt 5%;width:90%;"\n
<img src="" style="margin:0pt 5%" alt=""\n
tal:attributes="src\n
string:${here/absolute_url}/index_html?display=${display}&format=${format}&frame=${frame}&resolution:int=300">\n
string:${here/absolute_url}/index_html?display=${display}&format=${format}&frame=${frame}&resolution:int=300"/>\n
</div>
]]></string> </value>
......
......@@ -66,11 +66,11 @@
</a>\n
</tal:block>\n
<tal:block tal:condition="python:current_thumbnail_index < 1">\n
<img src="images/2leftarrowb.png" style="opacity:0.2"\n
<img src="images/2leftarrowb.png" style="opacity:0.2; vertical-align:middle"\n
i18n:attributes="alt"\n
i18n:domain="ui"\n
alt="First"/>\n
<img src="images/1leftarrowb.png" style="opacity:0.2"\n
<img src="images/1leftarrowb.png" style="opacity:0.2; vertical-align:middle"\n
i18n:attributes="alt"\n
i18n:domain="ui"\n
alt="Previous"/>\n
......@@ -93,11 +93,11 @@
</a>\n
</tal:block>\n
<tal:block tal:condition="python:all_thunmbnails <= next_thunmbnail_index">\n
<img src="images/1rightarrowb.png" style="opacity:0.1"\n
<img src="images/1rightarrowb.png" style="opacity:0.2; vertical-align:middle"\n
i18n:attributes="alt"\n
i18n:domain="ui"\n
alt="Next"/>\n
<img src="images/2rightarrowb.png" style="opacity:0.1"\n
<img src="images/2rightarrowb.png" style="opacity:0.2; vertical-align:middle"\n
i18n:attributes="alt"\n
i18n:domain="ui"\n
alt="Last"/>\n
......
......@@ -115,7 +115,7 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python:\'<button class="bt-med right" name="Base_download:method" title="%(title)s" alt="%(title)s"><span>%(title)s</span></button>\' % {\'title\':here.Base_translateString("Download as PDF")}
python:\'<button class="bt-med right" name="Base_download:method" title="%(title)s"><span>%(title)s</span></button>\' % {\'title\':here.Base_translateString("Download as PDF")}
]]></string> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="WorklistDefinition" module="Products.DCWorkflow.Worklists"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Documents to review (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
ERP5Site_viewDocumentList?validation_state=draft&local_roles=%(local_roles)s&portal_type=%(portal_type)s&reset=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Documents to review</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>draft_to_review</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>validation_state</string> </key>
<value>
<tuple>
<string>draft</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1110
\ No newline at end of file
1118
\ No newline at end of file
......@@ -449,7 +449,7 @@ div#main_content > fieldset.webcontent {\n
/* TODO: redo webcontent header spacing policy because lack of consistency\n
(not tested with huge titles) */\n
\n
div#main_content > fieldset#fieldset_webcontent {padding: 2em}\n
div#main_content > fieldset.webcontent {padding: 2em}\n
\n
div#main_content > fieldset.header {\n
padding-bottom: 1em;\n
......
......@@ -382,7 +382,7 @@ div#main_content > fieldset.webcontent {\n
/* TODO: redo webcontent header spacing policy because lack of consistency\n
(not tested with huge titles) */\n
\n
div#main_content > fieldset#fieldset_webcontent {padding: 2em}\n
div#main_content > fieldset.webcontent {padding: 2em}\n
\n
div#main_content > fieldset.header {\n
padding-bottom: 1em;\n
......@@ -418,7 +418,8 @@ div#main_content fieldset.webcontent span.headline {\n
text-shadow: .1em .1em .1em #eee;\n
line-height: 140%;\n
text-align: left;\n
}
}\n
]]></string> </value>
</item>
......
......@@ -529,14 +529,14 @@ div#main_content fieldset {\n
border:none;\n
}\n
\n
.content #fieldset_center,\n
.content #fieldset_left,\n
.content #fieldset_bottom{\n
.content fieldset.center,\n
.content fieldset.left,\n
.content fieldset.bottom{\n
margin-left: 3em;\n
margin-right: 3em;\n
}\n
\n
.content #fieldset_left{\n
.content fieldset.left{\n
margin-top: 3em;\n
}\n
\n
......@@ -653,12 +653,12 @@ fieldset.register_informations{\n
}\n
\n
\n
#main_form #main_content #fieldset_bottom .input .ListSummary{\n
#main_form #main_content fieldset.bottom .input .ListSummary{\n
margin-top: 100px;\n
}\n
\n
#main_form #main_content #fieldset_bottom .input .ListSummary,\n
#main_form #main_content #fieldset_bottom .input .ListContent{\n
#main_form #main_content fieldset.bottom .input .ListSummary,\n
#main_form #main_content fieldset.bottom .input .ListContent{\n
margin-right: 10%;\n
margin-left: 10%;\n
}\n
......
461
\ No newline at end of file
462
\ No newline at end of file
......@@ -107,6 +107,27 @@
</a>\n
</li>\n
</tal:block>\n
<tal:block tal:condition="python: here.Base_checkPermission(\'person_module\', \'Add portal content\')">\n
<li>\n
<a href="#" i18n:translate="" i18n:domain="ui" tal:attributes="href string:${current_web_section_url}/PersonModule_createNewPerson">\n
New Contact\n
</a>\n
</li>\n
</tal:block>\n
<tal:block tal:condition="python: here.Base_checkPermission(\'project_module\', \'Add portal content\')">\n
<li>\n
<a href="#" i18n:translate="" i18n:domain="ui" tal:attributes="href string:${current_web_section_url}/ProjectModule_createNewProject">\n
New Project\n
</a>\n
</li>\n
</tal:block>\n
<tal:block tal:condition="python: here.Base_checkPermission(\'task_module\', \'Add portal content\')">\n
<li>\n
<a href="#" i18n:translate="" i18n:domain="ui" tal:attributes="href string:${current_web_section_url}/TaskModule_createNewTask">\n
New Task\n
</a>\n
</li>\n
</tal:block>\n
</ul>\n
<!--[if lte IE 6]></td></tr></table></a><![endif]-->\n
</li>\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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
Create new Person object and redirect to it.\n
"""\n
\n
person = context.person_module.newContent(portal_type = \'Person\')\n
keep_items = dict(editable_mode=1,\n
portal_status_message=context.Base_translateString("New Person Created"))\n
return person.Base_redirect(\'view\', keep_items)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>person</string>
<string>dict</string>
<string>keep_items</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PersonModule_createNewPerson</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -62,7 +62,9 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>gadget</string>
<string>center</string>
<string>left</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
......@@ -72,19 +74,33 @@
<value>
<dictionary>
<item>
<key> <string>gadget</string> </key>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_add_new_person_link</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>default</string>
<string>editable</string>
<string>enabled</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_add_new_person_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>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<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>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>hidden_label button</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_editor_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>Editor Field</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: \'<a class="bt-small" style="width:250px;" href="%s/person_module/PersonModule_createNewPerson?cancel_url=%s"><span><img src="km_img/icon-add.png" alt="+"/> Add New Contact</span></a>\' %(here.getWebSiteValue().absolute_url(), here.absolute_url())
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_checkPermission(\'project_module\', \'Add portal content\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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
Create new Project object and redirect to it.\n
"""\n
\n
project = context.project_module.newContent(portal_type = \'Project\')\n
keep_items = dict(editable_mode=1,\n
portal_status_message=context.Base_translateString("New Project Created"))\n
return project.Base_redirect(\'view\', keep_items)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>project</string>
<string>dict</string>
<string>keep_items</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ProjectModule_createNewProject</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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
Create new Task object and redirect to it.\n
"""\n
\n
task = context.task_module.newContent(portal_type = \'Task\')\n
keep_items = dict(editable_mode=1,\n
portal_status_message=context.Base_translateString("New Task Created"))\n
return task.Base_redirect(\'view\', keep_items)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>task</string>
<string>dict</string>
<string>keep_items</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TaskModule_createNewTask</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -69,7 +69,6 @@ class TestGadgets(ERP5TypeTestCase, ZopeTestCase.Functional):
portal = self.getPortal()
web_site_module = portal.web_site_module
self.website = web_site_module.newContent(portal_type='Web Site')
#self.website.setSkinSelectionName('KM')
self.websection = self.website.newContent(portal_type='Web Section')
self.app.REQUEST.set('current_web_section', self.websection)
self.webpage = portal.web_page_module.newContent(
......@@ -610,6 +609,7 @@ class TestGadgets(ERP5TypeTestCase, ZopeTestCase.Functional):
subsection = self.websection.newContent(portal_type='Web Section',
title='Sub Section 12345')
self.stepTic()
self.changeSkin('KM')
self.failUnless(subsection.getTitle() in
self.publish(self.base_url_pattern %(self.web_section_url,
gadget_view_form_id,
......
1332
\ No newline at end of file
1342
\ No newline at end of file
......@@ -87,10 +87,19 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']</td>\n
<td>Home Web Pages test page</td>\n
<td>//ul[@class=\'breadcrumb\']/li[1]/a</td>\n
<td>Home</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']/li[2]/a</td>\n
<td>Web Pages</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']/li[3]/a</td>\n
<td>test page</td>\n
</tr>\n
\n
<tal:block metal:use-macro="here/KMZuite_CommonTemplate/macros/deleteKMWebSite" />\n
\n
</tbody></table>\n
......
......@@ -105,8 +105,18 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']</td>\n
<td>Home Web Pages test page</td>\n
<td>//ul[@class=\'breadcrumb\']/li[1]/a</td>\n
<td>Home</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']/li[2]/a</td>\n
<td>Web Pages</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//ul[@class=\'breadcrumb\']/li[3]/a</td>\n
<td>test page</td>\n
</tr>\n
<tal:block metal:use-macro="here/KMZuite_CommonTemplate/macros/deleteKMWebSite" />\n
\n
......
......@@ -84,8 +84,8 @@ km_preference = portal_preferences.newContent(\n
preferred_document_file_name_regular_expression = \'(?P<node_reference>[a-zA-Z0-9_-]+)-(?P<local_reference>[a-zA-Z0-9_.]+)-(?P<version>[0-9a-zA-Z.]+)-(?P<language>[a-z]{2})[^-]*?\',\n
preferred_synchronous_metadata_discovery = False,\n
preferred_redirect_to_document = False,\n
preferred_ooodoc_server_address = \'localhost\',\n
preferred_ooodoc_server_port_number = 8008)\n
preferred_ooodoc_server_address = context.Zuite_getConversionServerDict()["oood_hostname"],\n
preferred_ooodoc_server_port_number = context.Zuite_getConversionServerDict()["oood_port"])\n
km_preference.enable()\n
\n
return "Created Successfully."\n
......@@ -144,6 +144,7 @@ return "Created Successfully."\n
<string>km_preference_id</string>
<string>portal_preferences</string>
<string>False</string>
<string>_getitem_</string>
<string>km_preference</string>
</tuple>
</value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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 the configuration for use into\n
preferences.\n
"""\n
return dict(oood_hostname="localhost",\n
oood_port=8008)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_getConversionServerDict</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
41
\ No newline at end of file
44
\ No newline at end of file
......@@ -88,6 +88,14 @@ return parameters\n
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
......
506
\ No newline at end of file
509
\ No newline at end of file
......@@ -6546,14 +6546,8 @@ msgstr "Numéro"
msgid "Number of Lines Displayed in List Mode ListBoxes"
msgstr "Nombre de lignes affichées en mode liste"
msgid "Number of Lines Displayed in List Mode ListBoxs"
msgstr "Nombre de lignes affichées dans une listbox en mode liste"
msgid "Number of Lines Displayed in View Mode ListBoxes"
msgstr "Nombre de lignes affichées en mode général"
msgid "Number of Lines Displayed in View Mode ListBoxs"
msgstr "Nombre de lignes affichées dans une listbox en mode view"
msgstr "Nombre de lignes affichées en mode vue"
msgid "Number of Lines to Add"
msgstr "Nombre de lignes à ajouter"
......
......@@ -1176,22 +1176,23 @@ body {\n
font-weight: bold;\n
}\n
\n
#fieldset_left,\n
#fieldset_right,\n
#fieldset_center,\n
#fieldset_bottom {\n
fieldset.left,\n
fieldset.right,\n
fieldset.center,\n
fieldset.bottom {\n
border-width: 1px;\n
border-style: solid;\n
}\n
\n
#fieldset_left legend,\n
#fieldset_right legend,\n
#fieldset_center legend,\n
#fieldset_bottom legend {\n
fieldset.left legend,\n
fieldset.right legend,\n
fieldset.center legend,\n
fieldset.bottom legend {\n
display: none;\n
}\n
\n
</dtml-let>
</dtml-let>\n
]]></string> </value>
</item>
......
......@@ -107,8 +107,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
<tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid">\n
<fieldset tal:condition="python: \'hidden\' not in gid and \'bottom\' not in gid"\n
tal:attributes="class gid;\n
id python: \'fieldset_\' + gid.replace(\' \', \'_\');"\n
tal:attributes="class gid;"\n
tal:define="gtitle group/gtitle">\n
<legend tal:condition="python: gtitle != \'bottom\' and gtitle != \'left\' and gtitle != \'right\' and gtitle != \'center\'" tal:content="group/gtitle" class="group_title"/>\n
<tal:block tal:repeat="field python: form.get_fields_in_group(group[\'goid\'])">\n
......
......@@ -96,8 +96,7 @@ It is possible to specify a group id and a group title by naming a group followi
<tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid;">\n
<fieldset tal:condition="python: gid.find(\'hidden\') < 0"\n
tal:attributes="class gid;\n
id python: \'fieldset_%s\' % (gid.replace(\' \', \'_\'), );"\n
tal:attributes="class gid;"\n
tal:define="gtitle group/gtitle"\n
class="border">\n
<legend tal:condition="python: gtitle != \'bottom\' and gtitle != \'left\' and gtitle != \'right\' and gtitle != \'center\'" tal:content="group/gtitle" class="group_title"/>\n
......@@ -115,7 +114,8 @@ It is possible to specify a group id and a group title by naming a group followi
<a class="link_white" tal:attributes="href python: \'%s%s%s%s\' % (context.REQUEST.URL0,\'?\', context.REQUEST.QUERY_STRING,\'#TOP\')" i18n:translate="" i18n:domain="ui">////////// Top of page \\\\\\\\\\\\\\\\\\\\</a>\n
</div>\n
</tal:block>\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
......@@ -89,7 +89,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
type="hidden" name="came_from"\n
tal:attributes="value request/came_from" />\n
\n
<fieldset id="fieldset_left" class="fielset_login">\n
<fieldset class="left fielset_login">\n
<div class="field">\n
<label for="name" class="required" i18n:translate="" i18n:domain="ui">Name</label>\n
<div class="input"><input type="text" name="__ac_name" id="name" tal:attributes="value python: request.get(\'__ac_name\') or \'\'"/></div>\n
......@@ -132,7 +132,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
</div>\n
</tal:block>\n
</tal:block>\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
55
\ No newline at end of file
56
\ No newline at end of file
......@@ -103,7 +103,7 @@
<!-- if the group bottom there isn\'t a title -->\n
<table:table-cell table:number-rows-spanned=\'1\'\n
table:style-name=\'report-content-heading2-with-lines\'\n
tal:attributes="table:number-columns-spanned python:group == \'bottom\' and column_len or column_len-1"\n
tal:attributes="table:number-columns-spanned python:group == \'bottom\' and column_len or max(column_len-1, 1)"\n
office:value-type=\'string\'\n
tal:define="value python: field.get_value(\'default\')">\n
<tal:block tal:condition="python: same_type(value, []) or same_type(value, ())">\n
......
......@@ -103,6 +103,8 @@ dQEAAAAA</string> </value>
</tal:block>\n
</tal:block>\n
\n
<!-- save the context for the macros -->\n
<tal:block tal:define="dummy python: request.set(\'here\', here)">\n
<!-- Calculating by group the max length of columns to merge -->\n
<tal:block tal:repeat="group python: [g for g in group_list if g not in (\'hidden\', )]">\n
<!-- if we have other fields to display, calculate max column len, which will be used \n
......@@ -110,16 +112,14 @@ dQEAAAAA</string> </value>
<tal:block tal:define="global field_list python: form.get_fields_in_group(group)"/>\n
<tal:block tal:condition="python:len(field_list) &gt; 0">\n
<tal:block tal:define="global column_len python: 5"/>\n
<tal:block tal:condition="report_item | nothing">\n
<tal:block tal:define="global column_len python: report_item.selection_columns and len(report_item.selection_columns) or 0;"/>\n
</tal:block>\n
<tal:block tal:condition="python: column_len &lt; 6">\n
<tal:block tal:repeat="field python:field_list">\n
<tal:block tal:condition="python:field.meta_type == \'ListBox\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'ListBox\')">\n
<tal:block tal:define="column_list python: field.get_value(\'columns\');\n
global column_len python: max(column_len, len(column_list))" />\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="report_item | nothing">\n
<tal:block tal:define="global column_len python: report_item.selection_columns and len(report_item.selection_columns) or column_len;"/>\n
</tal:block>\n
<!-- Display field -->\n
<tal:block tal:repeat="field python:field_list">\n
......@@ -131,6 +131,7 @@ dQEAAAAA</string> </value>
</table:table-row>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table>\n
</office:spreadsheet>\n
</office:body>\n
......
231
233
\ No newline at end of file
......@@ -67,7 +67,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>Base_initIntIndexAndReference</string> </value>
<value> <string>Base_initIntIndex</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -67,7 +67,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>Base_initIntIndexAndReference</string> </value>
<value> <string>Base_initIntIndex</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -67,7 +67,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>Base_initIntIndexAndReference</string> </value>
<value> <string>Base_initIntIndex</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -53,8 +53,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>state_change[\'object\'].getResourceValue().reindexObject()\n
</string> </value>
<value> <string encoding="cdata"><![CDATA[
resource = state_change[\'object\'].getResourceValue()\n
if len(context.portal_catalog(uid=resource.getUid())) > 0:\n
# Reindex resource only when resource is not unindexed.\n
resource.reindexObject()\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -93,6 +100,9 @@
<string>state_change</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>resource</string>
<string>len</string>
<string>context</string>
</tuple>
</value>
</item>
......
2010-04-22 yusei
* Fix Measure_reindexResource in conversion_interaction_workflow. Reindex resource only when measure is unindexed but resource is not.
2010-03-09 Nicolas Dumazet
* Merge measure & quantity_unit_conversion interaction workflows into conversion_interaction_workflow
......
490
\ No newline at end of file
492
\ No newline at end of file
......@@ -68,6 +68,10 @@
<key> <string>catalog_index</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
......@@ -167,7 +171,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:portal.getDefaultModuleId(\'Project Module\', None)</string> </value>
<value> <string>python: here.getPortalObject().getDefaultModuleId(\'Project Module\', None)</string> </value>
</item>
</dictionary>
</pickle>
......
760
\ No newline at end of file
761
\ No newline at end of file
......@@ -95,10 +95,8 @@ class InvoicingRuleMovementGenerator(MovementGeneratorMixin):
def getGeneratedMovementList(self, context, movement_list=None,
rounding=False):
"""
Input movement list comes from order
XXX This implementation is very primitive, and does not support BPM,
i.e. business paths are not taken into account.
In Invoice Simulation Rule, source should be source_administration
of the input movement or its order's source. Same for destination.
"""
ret = []
rule = context.getSpecialiseValue()
......@@ -106,7 +104,13 @@ class InvoicingRuleMovementGenerator(MovementGeneratorMixin):
._getInputMovementAndPathTupleList(context):
kw = self._getPropertyAndCategoryList(input_movement, business_path,
rule)
kw.update({'order':None,'delivery':None})
root_simulation_movement = input_movement.getRootSimulationMovement()
source = input_movement.getSourceAdministration() or \
root_simulation_movement.getSource()
destination = input_movement.getDestinationAdministration() or \
root_simulation_movement.getDestination()
kw.update({'order':None, 'delivery':None,
'source':source, 'destination':destination})
simulation_movement = context.newContent(
portal_type=RuleMixin.movement_type,
temp_object=True,
......
81
\ No newline at end of file
82
\ No newline at end of file
......@@ -58,6 +58,10 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
......@@ -82,6 +86,10 @@
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -152,7 +160,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(here.portal_categories[field.getId().replace(\'my_\', \'\', 1)], preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
<value> <string>python: getattr(here, \'Immobilisation_getAmortisationMethodDisplayList\', lambda a: [])()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -13,15 +13,16 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable_columns</string>
<string>domain_tree</string>
<string>columns</string>
<string>count_method</string>
<string>default_params</string>
<string>domain_root_list</string>
<string>title</string>
<string>domain_tree</string>
<string>editable_columns</string>
<string>list_action</string>
<string>selection_name</string>
<string>default_params</string>
<string>list_method</string>
<string>columns</string>
<string>selection_name</string>
<string>title</string>
</list>
</value>
</item>
......@@ -63,6 +64,28 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -71,10 +94,26 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -125,23 +164,16 @@
</list>
</value>
</item>
<item>
<key> <string>count_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list>
<tuple>
<string>group_by_node</string>
<string>1</string>
</tuple>
<tuple>
<string>group_by_variation</string>
<string>1</string>
</tuple>
<tuple>
<string>group_by_section</string>
<string>0</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -189,7 +221,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -202,7 +234,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Stock by Variation</string> </value>
<value> <string>Stock per Variation</string> </value>
</item>
</dictionary>
</value>
......@@ -211,6 +243,38 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[(\'group_by_section\', 0), (\'group_by_node\', 1), (\'group_by_variation\', 1)]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>getFutureInventoryCount</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
......
......@@ -74,7 +74,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_delivery_mode</string> </value>
<value> <string>my_view_mode_delivery_mode</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
907
\ No newline at end of file
910
\ No newline at end of file
This business template holds obsolete fields libraries. It is only usefull for custom projects that still use old libraries.
\ No newline at end of file
This business template holds obsolete fields libraries. It is only useful for custom projects that still use old libraries.
\ No newline at end of file
7
\ No newline at end of file
8
\ No newline at end of file
......@@ -43,12 +43,12 @@
xmlns:metal="http://xml.zope.org/namespaces/metal">\n
<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
<title>Test Float Value with Integer Fields</title>\n
<title>Test Float Value with Float Fields</title>\n
</head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="3">Test Float Value with Integer Fields</td></tr>\n
<tr><td rowspan="1" colspan="3">Test Float Value with Float Fields</td></tr>\n
</thead><tbody>\n
<tal:block metal:use-macro="here/ListBoxZuite_CommonTemplate/macros/init" />\n
<tr>\n
......@@ -93,7 +93,7 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[@id="fieldset_right"]//div[@class="field"][2]//div</td>\n
<td>//fieldset[@class="right editable"]//div[@class="field"][2]//div</td>\n
<td>10.0</td>\n
</tr>\n
<tr>\n
......@@ -114,11 +114,11 @@
<tr>\n
<td>verifyValue</td>\n
<td>field_my_quantity</td>\n
<td>1000000000000.000000</td>\n
<td>1000000000000.0</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[@id="fieldset_right"]//div[@class="field"][2]//div</td>\n
<td>//fieldset[@class="right editable"]//div[@class="field"][2]//div</td>\n
<td>1 000 000 000 000.0</td>\n
</tr>\n
</tbody></table>\n
......
......@@ -93,7 +93,7 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[@id="fieldset_left"]//span[@class="foo"]</td>\n
<td>//fieldset[@class="left editable"]//span[@class="foo"]</td>\n
<td>10</td>\n
</tr>\n
\n
......
......@@ -100,7 +100,7 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[@id=\'fieldset_bottom\']/div[1]/div/div/table/tbody/tr[2]/td[2]</td>\n
<td>//fieldset[@class=\'bottom editable\']/div[1]/div/div/table/tbody/tr[2]/td[2]</td>\n
<td>*You did not enter a floating point*</td>\n
</tr>\n
<tr>\n
......@@ -164,7 +164,7 @@
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[@id=\'fieldset_bottom\']/div[1]/div/div/table/tbody/tr[2]/td[2]</td>\n
<td>//fieldset[@class=\'bottom editable\']/div[1]/div/div/table/tbody/tr[2]/td[2]</td>\n
<td>*You did not enter a floating point*</td>\n
</tr>\n
<tr>\n
......
......@@ -99,7 +99,7 @@
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//fieldset[@id=\'fieldset_left\']/div[4]/div/a/img[@alt="jump"]</td>\n
<td>//fieldset[@class=\'left editable\']/div[4]/div/a/img[@alt="jump"]</td>\n
<td></td>\n
<td></td>\n
</tr>\n
......@@ -145,7 +145,7 @@ bar_category/foo_module/1</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//fieldset[@id=\'fieldset_left\']/div[4]/div/a/img[@alt="jump"]</td>\n
<td>//fieldset[@class=\'left editable\']/div[4]/div/a/img[@alt="jump"]</td>\n
<td></td>\n
<td></td>\n
</tr>\n
......
......@@ -200,7 +200,7 @@
<tal:block tal:condition="python: context.TestTool_getSkinName()!=\'Mobile\'">\n
<tr>\n
<td>verifyElementPresent</td>\n
<td>//fieldset[@id=\'fieldset_right\']/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td>//fieldset[@class=\'right editable\']/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td/>\n
</tr>\n
<tr>\n
......@@ -217,7 +217,7 @@
<tal:block tal:condition="python: context.TestTool_getSkinName()==\'Mobile\'">\n
<tr>\n
<td>verifyElementPresent</td>\n
<td>//fieldset[@id=\'fieldset_right\']/div[1]/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td>//fieldset[@class=\'right editable\']/div[1]/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td/>\n
</tr>\n
<tr>\n
......
......@@ -128,7 +128,7 @@
<tal:block tal:condition="python: context.TestTool_getSkinName()!=\'Mobile\'">\n
<tr>\n
<td>verifyElementPresent</td>\n
<td>//fieldset[@id=\'fieldset_right\']/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td>//fieldset[@class=\'right editable\']/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td/>\n
</tr>\n
<tr>\n
......@@ -145,7 +145,7 @@
<tal:block tal:condition="python: context.TestTool_getSkinName()==\'Mobile\'">\n
<tr>\n
<td>verifyElementPresent</td>\n
<td>//fieldset[@id=\'fieldset_right\']/div[1]/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td>//fieldset[@class=\'right editable\']/div[1]/div[@class=\'field error\']/span[@class=\'error\']</td>\n
<td/>\n
</tr>\n
<tr>\n
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>required</string> </key>
......
......@@ -87,6 +87,7 @@
<value>
<list>
<string>listbox_title</string>
<string>my_constant_string_field</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>display_width</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_constant_string_field</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>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<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>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<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>my_constant_string_field</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>string:a constant of forty-two is still the answer</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -95,6 +95,7 @@
<string>listbox_title</string>
<string>listbox_id</string>
<string>listbox_quantity</string>
<string>listbox_constant_string_field</string>
</list>
</value>
</item>
......
556
\ No newline at end of file
561
\ No newline at end of file
......@@ -14,7 +14,6 @@
<value>
<list>
<string>title</string>
<string>items</string>
</list>
</value>
</item>
......@@ -64,12 +63,6 @@
<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>
......@@ -93,12 +86,6 @@
<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>
......@@ -113,20 +100,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_categories[field.getId().replace(\'my_\', \'\', 1).replace(\'_list\', \'\')].getCategoryChildTranslatedCompactLogicalPathItemList(display_none_category=1, local_sort_id="translated_short_title",checked_permission=\'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -470,7 +470,7 @@ div#main_content > fieldset.webcontent {\n
/* TODO: redo webcontent header spacing policy because lack of consistency\n
(not tested with huge titles) */\n
\n
div#main_content > fieldset#fieldset_webcontent {padding: 2em}\n
div#main_content > fieldset.webcontent {padding: 2em}\n
\n
div#main_content > fieldset.header {\n
padding-bottom: 1em;\n
......@@ -509,7 +509,8 @@ div#main_content fieldset.webcontent span.headline {\n
text-align: left;\n
}\n
\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
930
\ No newline at end of file
933
\ No newline at end of file
None
\ No newline at end of file
......@@ -486,7 +486,7 @@ div.input select, div.input textarea {\n
margin:5px 0;\n
}\n
\n
#fieldset_bottom > div.field > div.input > textarea {\n
fieldset.bottom > div.field > div.input > textarea {\n
width:<tal:block tal:replace="python:main_content_width-2"/>px;\n
}\n
\n
......
178
\ No newline at end of file
179
\ No newline at end of file
......@@ -7,6 +7,8 @@ httpd_port = 8181
httpd_datadir = ${buildout:var-directory}/httpd
httpd_htdocs = ${:httpd_datadir}/htdocs
httpd_cgibin = ${:httpd_datadir}/cgi-bin
httpd_vhost_rewrite_rules =
RewriteRule ^/static(.*) ${configuration:httpd_htdocs}$1 [L]
[apache-httpd]
recipe = collective.recipe.template
......@@ -14,6 +16,11 @@ input = ${software_definition:software_home}/templates/httpd.in
output = ${buildout:data-bin-directory}/httpd
config-path = ${apache-conf:output}
[apache-vhost]
recipe = collective.recipe.template
input = ${software_definition:software_home}/templates/httpd.vhost.conf.in
output = ${buildout:var-directory}/etc/httpd.vhost.conf
[apache-conf]
recipe = collective.recipe.template
input = ${software_definition:software_home}/templates/httpd.conf.in
......@@ -24,6 +31,7 @@ depends =
${create-directories:command}
${apache-httpd:output}
${apache-conf:output}
${apache-vhost:output}
recipe = plone.recipe.command
command =
......
......@@ -27,7 +27,7 @@ supervisor_programs =
recipe = plone.recipe.command
command =
ln -sf ${software_definition:software_home}/bin/python2.4 ${buildout:bin-directory}/python2.4
#ln -sf ${software_definition:software_home}/bin/ipython2.4 ${buildout:bin-directory}/ipython2.4
ln -sf ${software_definition:software_home}/bin/ipython2.4 ${buildout:bin-directory}/ipython2.4
update-command = ${:command}
[software_definition]
......
......@@ -3,12 +3,13 @@
erp5diff = 0.2
python-memcached = 1.45
PyXML = 0.8.4
#ipdb = 0.1dev_r1716
ipdb = 0.1dev_r1716
itools = 0.20.8
numpy = 1.3.0
plone.recipe.zope2instance = 3.6
erp5.recipe.standaloneinstance >= 0.4
pysvn = 1.7.2
mechanize = 0.1.11
erp5_products_revision =
erp5_bt5_revision = ${:erp5_products_revision}
......@@ -47,10 +47,12 @@ version-suffix-packages =
recipe = infrae.subversion
# dircty hack to support PluginRegistry/utils.py:17 assumption that products
# are in Products folder
# XXX: Zelenium was eggfied for recent zope versions (2.12) and are available at Bazaar.
# some better alternative should be used in future.
location = parts/products-other/Products
urls =
http://svn.plone.org/svn/collective/DCWorkflowGraph/tags/release-0_3/ DCWorkflowGraph
svn://svn.zope.org/repos/main/Zelenium/trunk/ Zelenium
svn://svn.zope.org/repos/main/Zelenium/trunk/@110603 Zelenium
svn://svn.zope.org/repos/main/PluginRegistry/tags/1.0 PluginRegistry
http://svn.plone.org/svn/archetypes/MimetypesRegistry/tags/Archetypes-1.4.0-final MimetypesRegistry
......@@ -64,8 +66,7 @@ eggs =
cElementTree
elementtree
erp5diff
# It depends of ipython, which is already disabled.
# ipdb
ipdb
lxml
mechanize
numpy
......@@ -79,6 +80,8 @@ eggs =
threadframe
timerserver
uuid
zope.testbrowser
python = python2.4
dependent-scripts = true
interpreter = python${python2.4:version}
......
......@@ -32,8 +32,7 @@ extra-paths =
dependent-scripts = true
scripts =
invokepython=python${python2.4:python_version_major}
# The download of ipython is failing to often and it is broking the building process of RPM.
# ipython=ipython${python2.4:python_version_major}
ipython=ipython${python2.4:python_version_major}
[bootstrap2.4]
recipe = zc.recipe.egg
......
......@@ -153,3 +153,5 @@ DefaultType text/plain
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include ${buildout:var-directory}/etc/*.vhost.conf
<VirtualHost *:${configuration:httpd_port}>
ServerName localhost
DocumentRoot ${configuration:httpd_htdocs}
HostnameLookups Off
UseCanonicalName Off
ServerSignature Off
RewriteEngine On
ProxyVia on
ProxyTimeout 1200
${configuration:httpd_vhost_rewrite_rules}
<Location "/">
Order Allow,Deny
Allow from all
</Location>
</VirtualHost>
......@@ -13,20 +13,14 @@ def createCleanList(s):
return sorted([q.strip() for q in s.split() if len(q.strip()) > 0])
class AssertPythonSoftware(unittest.TestCase):
"""
TODO: Add doc string.
"""
"""Asserts that python related software is in good shape."""
def test_python_version(self):
"""
TODO: Add doc string.
"""
"""Check built python version"""
self.assertEqual((2,4), sys.version_info[:2])
def test_use_generated_python(self):
"""
TODO: Add doc string.
"""
"""Checks generated python as python"""
fd, name = tempfile.mkstemp()
try:
f = os.fdopen(fd, 'w')
......@@ -45,17 +39,13 @@ print sys.version_info[:2]
os.unlink(name)
def test_use_generated_python_as_normal_interpreter(self):
"""
TODO: Add doc string.
"""
"""Checks behabiour of generated python as interpreter"""
stdout, stderr = subprocess.Popen(["bin/python2.4", "-V"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
self.assertTrue('Python 2.4' in stderr)
def test_required_libraries(self):
"""
TODO: Add doc string.
"""
"""Checks possiblity of importing libraries"""
required_library_list = createCleanList("""
ERP5Diff
MySQLdb
......@@ -84,6 +74,7 @@ print sys.version_info[:2]
xml
xml.parsers.expat
zlib
zope.testbrowser
""")
failed_library_list = []
for lib in required_library_list:
......@@ -95,43 +86,31 @@ print sys.version_info[:2]
'Python libraries not found:\n'+'\n'.join(failed_library_list))
class AssertLddLibs(unittest.TestCase):
"""
TODO: Add doc string.
"""
"""Checks for dynamic libraries"""
def test_tritonn_senna(self):
"""
TODO: Add doc string.
"""
"""Senna as an library"""
result = os.system("ldd parts/mysql-tritonn-5.0/libexec/mysqld | grep -q "
"'parts/senna/lib/libsenna.so.0'")
self.assertEqual(result, 0)
def test_MySQLdb(self):
"""
TODO: Add doc string.
"""
"""Checks proper linking to mysql library from MySQLdb egg"""
result = os.system("ldd develop-eggs/MySQL_python-1.2.3c1-py2.4-linux-x86"
"_64.egg/_mysql.so | grep -q 'parts/mysql-tritonn-5.0/lib/mysql/libmys"
"qlclient_r.so'")
self.assertEqual(result, 0)
def test_memcached_libevent(self):
"""
TODO: Add doc string.
"""
"""Checks proper liunking to libevent from memcached"""
result = os.system("ldd parts/memcached/bin/memcached | grep -q 'parts/li"
"bevent/lib/libevent'")
class AssertApache(unittest.TestCase):
"""
TODO: Add doc string.
"""
"""Tests for built apache"""
def test_modules(self):
"""
TODO: Add doc string.
"""
"""Checks for availability of apache modules"""
required_module_list = createCleanList("""
authn_default_module
log_config_module
......@@ -210,6 +189,5 @@ class AssertApache(unittest.TestCase):
self.assertEqual([], failed_module_list,
'Apache modules not found:\n'+'\n'.join(failed_module_list))
if __name__ == '__main__':
unittest.main()
......@@ -24,6 +24,11 @@ function show_help ( )
MYSQL_OPT=$1
INTERVAL=$2
TIMEOUT=$3
MYSQL_BIN=$MYSQL
if [ "$MYSQL_BIN" == "" ] ; then
MYSQL_BIN='mysql'
fi
if [ "$MYSQL_OPT" == "" ] ; then
show_help
......@@ -41,8 +46,8 @@ TIME=0
while true
do
MESSAGE_VALUE=`echo "SELECT count(*) AS message_count FROM message;" | mysql $MYSQL_OPT | grep -v message`
MESSAGE_QUEUE_VALUE=`echo "SELECT count(*) AS message_count FROM message_queue;" | mysql $MYSQL_OPT | grep -v message`
MESSAGE_VALUE=`echo "SELECT count(*) AS message_count FROM message;" | $MYSQL_BIN $MYSQL_OPT | grep -v message`
MESSAGE_QUEUE_VALUE=`echo "SELECT count(*) AS message_count FROM message_queue;" | $MYSQL_BIN $MYSQL_OPT | grep -v message`
if [ "$MESSAGE_VALUE" == "0" -a "$MESSAGE_QUEUE_VALUE" == 0 ] ; then
exit 0
fi
......
......@@ -380,16 +380,11 @@ class BusinessPath(Path, Predicate):
root_applied_rule_list = []
delivery_simulation_movement_list = portal_catalog(
delivery_uid=[x.getUid() for x in explanation.getMovementList()])
# 'order' category is deprecated. it is kept for compatibility.
if len(delivery_simulation_movement_list) == 0:
delivery_simulation_movement_list = portal_catalog(
order_uid=[x.getUid() for x in explanation.getMovementList()])
for simulation_movement in delivery_simulation_movement_list:
applied_rule = simulation_movement.getRootAppliedRule()
applied_rule = simulation_movement.getRootAppliedRule().getPath()
if applied_rule not in root_applied_rule_list:
root_applied_rule_list.append(
simulation_movement.getRootAppliedRule())
root_applied_rule_list.append(applied_rule)
simulation_movement_list = portal_catalog(
portal_type='Simulation Movement', causality_uid=self.getUid(),
......
......@@ -889,6 +889,30 @@ class ERP5Site(FolderMixIn, CMFSite):
return self._getPortalGroupedTypeList('service') or \
self._getPortalConfiguration('portal_service_type_list')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalSaleTypeList')
def getPortalSaleTypeList(self):
"""
Return sale types.
"""
return self._getPortalGroupedTypeList('sale')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalPurchaseTypeList')
def getPortalPurchaseTypeList(self):
"""
Return purchase types.
"""
return self._getPortalGroupedTypeList('purchase')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalInternalTypeList')
def getPortalInternalTypeList(self):
"""
Return internal types.
"""
return self._getPortalGroupedTypeList('internal')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalAlarmTypeList')
def getPortalAlarmTypeList(self):
......@@ -1355,44 +1379,10 @@ class PortalGenerator:
p.manage_addProduct['CMFCore'].manage_addCC(
id='cookie_authentication')
def setupMembersFolder(self, p):
PortalFolder.manage_addPortalFolder(p, 'Members')
p.Members.manage_addProduct['OFSP'].manage_addDTMLMethod(
'index_html', 'Member list', '<dtml-return roster>')
def setupRoles(self, p):
# Set up the suggested roles.
p.__ac_roles__ = ('Member', 'Reviewer',)
def setupPermissions(self, p):
# Set up some suggested role to permission mappings.
mp = p.manage_permission
mp(AccessFuturePortalContent, ['Reviewer','Manager',], 1)
mp(AddPortalContent, ['Owner','Manager',], 1)
mp(AddPortalFolders, ['Owner','Manager',], 1)
mp(ListPortalMembers, ['Member','Manager',], 1)
mp(ListUndoableChanges, ['Member','Manager',], 1)
mp(ReplyToItem, ['Member','Manager',], 1)
mp(ReviewPortalContent, ['Reviewer','Manager',], 1)
mp(SetOwnPassword, ['Member','Manager',], 1)
mp(SetOwnProperties, ['Member','Manager',], 1)
# Add some other permissions mappings that may be helpful.
mp(DeleteObjects, ['Owner','Manager',], 1)
mp(FTPAccess, ['Owner','Manager',], 1)
mp(ManageProperties, ['Owner','Manager',], 1)
mp(UndoChanges, ['Owner','Manager',], 1)
mp(ViewManagementScreens, ['Owner','Manager',], 1)
def setupTypes(self, p, initial_types=factory_type_information):
tool = getToolByName(p, 'portal_types', None)
if tool is None:
return
for t in initial_types:
fti = FactoryTypeInformation(**t)
tool._setObject(t['id'], fti)
def setupMimetypes(self, p):
p.manage_addProduct[ 'CMFCore' ].manage_addRegistry()
reg = p.content_type_registry
......@@ -1417,38 +1407,6 @@ class PortalGenerator:
reg.getPredicate( 'file' ).edit( major="application", minor="" )
reg.assignTypeName( 'file', 'File' )
def setup(self, p, create_userfolder):
from Products.CMFTopic import Topic
self.setupTools(p)
self.setupMailHost(p)
if int(create_userfolder) != 0:
self.setupUserFolder(p)
self.setupCookieAuth(p)
self.setupMembersFolder(p)
self.setupRoles(p)
self.setupPermissions(p)
self.setupDefaultSkins(p)
# SkinnedFolders are only for customization;
# they aren't a default type.
default_types = tuple( filter( lambda x: x['id'] != 'Skinned Folder'
, factory_type_information ) )
self.setupTypes(p, default_types )
self.setupTypes(p, PortalFolder.factory_type_information)
self.setupTypes(p, Topic.factory_type_information)
self.setupMimetypes(p)
self.setupWorkflow(p)
def create(self, parent, id, create_userfolder):
id = str(id)
portal = self.klass(id=id)
parent._setObject(id, portal)
# Return the fully wrapped object.
p = parent.this()._getOb(id)
self.setup(p, create_userfolder)
return p
def setupDefaultProperties(self, p, title, description,
email_from_address, email_from_name,
validate_email, default_charset=''):
......@@ -1951,10 +1909,6 @@ class ERP5Generator(PortalGenerator):
self.setupPermissions(p)
self.setupDefaultSkins(p)
# Finish setup
if not p.hasObject('Members'):
self.setupMembersFolder(p)
# ERP5 Design Choice is that all content should be user defined
# Content is disseminated through business templates
self.setupPortalTypes(p)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5TypeInformation" module="Products.ERP5Type.ERP5Type"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_property_domain_dict</string> </key>
<value>
<dictionary>
<item>
<key> <string>short_title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Cache Tool</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addFolder</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>module</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Dummy Class Tool</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>short_title</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>domain_name</string> </key>
<value> <string>erp5_ui</string> </value>
</item>
<item>
<key> <string>property_name</string> </key>
<value> <string>title</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -70,25 +70,6 @@ error = portal.portal_selections.selectionHasChanged(md5_object_uid_list,\n
\n
REQUEST=context.REQUEST\n
qs = \'\'\n
ret_url = \'\'\n
\n
getRelatedPropertyList = portal.portal_categories.getRelatedPropertyList\n
def Object_hasRelation(obj):\n
# Check if there is some related objets.\n
result = 0\n
for o in obj.getIndexableChildValueList():\n
for related_url in getRelatedPropertyList(o, property_name=\'relative_url\'):\n
if related_url.startswith(obj.getRelativeUrl()):\n
continue\n
elif related_url.startswith(\'portal_simulation\'):\n
continue\n
elif related_url.startswith(\'portal_trash\'):\n
continue\n
else:\n
result = 1\n
break\n
return result\n
\n
ret_url = context.absolute_url() + \'/\' + form_id\n
if error:\n
message = Base_translateString("Sorry, your selection has changed.")\n
......@@ -98,7 +79,7 @@ elif uids is not None:\n
object_used = 0\n
\n
object_list = [x.getObject() for x in context.Folder_getDeleteObjectList(uid=uids)]\n
object_used = sum([Object_hasRelation(x) for x in object_list])\n
object_used = sum([x.getRelationCountForDeletion() and 1 for x in object_list])\n
\n
if object_used > 0:\n
if object_used == 1:\n
......@@ -253,8 +234,6 @@ return REQUEST.RESPONSE.redirect("%s%s" % (ret_url, qs))\n
<string>REQUEST</string>
<string>qs</string>
<string>ret_url</string>
<string>getRelatedPropertyList</string>
<string>Object_hasRelation</string>
<string>message</string>
<string>None</string>
<string>object_used</string>
......
......@@ -257,18 +257,15 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: len(here.portal_categories.getRelatedValueList(cell))</string> </value>
<value> <string>cell/getRelationCountForDeletion</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -85,9 +85,6 @@
<list>
<string>my_preferred_section_category</string>
<string>my_preferred_section</string>
<string>my_preferred_date_order</string>
<string>my_preferred_float_number_style</string>
<string>my_preferred_money_quantity_style</string>
<string>my_preferred_user_interface_language_list</string>
<string>my_translated_preference_state_title</string>
</list>
......
......@@ -3,12 +3,18 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="TextAreaField" module="Products.Formulator.StandardFields"/>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_description</string> </value>
......@@ -21,22 +27,6 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -45,75 +35,15 @@
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
......@@ -124,75 +54,15 @@
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
......@@ -203,76 +73,16 @@
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>General description of a document in ERP5. Descriptions are not supposed to be internal, and in a case of certain documents such as invoices for example, will be seen by your customers.</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Description</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_description</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
......
......@@ -79,6 +79,7 @@
<key> <string>left</string> </key>
<value>
<list>
<string>my_preferred_date_order</string>
<string>my_preferred_html_style_developper_mode</string>
<string>my_preferred_html_style_contextual_help</string>
<string>my_preferred_html_style_translator_mode</string>
......@@ -92,7 +93,9 @@
<string>my_preferred_textarea_width</string>
<string>my_preferred_textarea_height</string>
<string>my_preferred_money_quantity_field_width</string>
<string>my_preferred_money_quantity_style</string>
<string>my_preferred_quantity_field_width</string>
<string>my_preferred_float_number_style</string>
<string>my_preferred_max_user_inactivity_duration</string>
</list>
</value>
......
1566
\ No newline at end of file
1570
\ No newline at end of file
......@@ -19,6 +19,7 @@ Document
Domain
Domain Generator
Domain Tool
Dummy Class Tool
Folder
Id Tool
Mapped Value
......
......@@ -151,10 +151,10 @@ function buildTables(element_list, rowPredicate, columnPredicate,\n
\n
function matchChunk(string, separator, chunk_value) {\n
if (string != null) {\n
var id_chunks = string.split(separator);\n
var chunk_list = string.split(separator);\n
var i;\n
for (i = 0; i < id_chunks.length; i++) {\n
if (id_chunks[i] == chunk_value)\n
for (i = 0; i < chunk_list.length; i++) {\n
if (chunk_list[i] == chunk_value)\n
return true;\n
}\n
}\n
......@@ -163,12 +163,12 @@ function matchChunk(string, separator, chunk_value) {\n
\n
function matchLeftFieldset(element) {\n
return (element.tagName == "FIELDSET") &&\n
matchChunk(element.id, \'_\', "left");\n
matchChunk(element.className, \' \', "left");\n
}\n
\n
function matchRightFieldset(element, ignored) {\n
if ((element.tagName == "FIELDSET") &&\n
matchChunk(element.id, \'_\', "right"))\n
matchChunk(element.className, \' \', "right"))\n
return 7; /* End row, table and use element */\n
return 0;\n
}\n
......@@ -327,7 +327,7 @@ var rewriteIndentedSelect = function() {\n
}\n
}\n
level = level / 4.;\n
options[j].innerHTML = options[j].innerHTML.replace(/&nbsp;/g, "");\n
options[j].innerHTML = options[j].innerHTML.replace(/^(&nbsp;)+/, "");\n
options[j].style.paddingLeft = level+"em";\n
\n
}\n
......
......@@ -113,8 +113,7 @@
<tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid">\n
<fieldset tal:condition="python: \'hidden\' not in gid and \'bottom\' not in gid and \'head\' not in gid"\n
tal:attributes="class gid;\n
id python: \'fieldset_\' + gid.replace(\' \', \'_\');">\n
tal:attributes="class gid;">\n
<legend tal:content="group/gtitle" class="group_title" />\n
<tal:block tal:repeat="field python: form.get_fields_in_group(group[\'goid\'])">\n
<tal:block metal:use-macro="field_render" />\n
......@@ -154,7 +153,8 @@
\n
</tal:block>\n
</tal:block>\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
......@@ -79,8 +79,7 @@ It is possible to specify a group id and a group title by naming a group followi
<tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid;">\n
<fieldset tal:condition="python: gid.find(\'hidden\') &lt; 0"\n
tal:attributes="class python:gid + test(request.get(\'editable_mode\', 0), \' editable\', \' viewable\');\n
id python: \'fieldset_%s\' % (gid.replace(\' \', \'_\'), );">\n
tal:attributes="class python:gid + test(request.get(\'editable_mode\', 0), \' editable\', \' viewable\');">\n
<legend i18n:translate="" i18n:domain="ui" tal:condition="group/gtitle" tal:content="group/gtitle" class="group_title"></legend>\n
<tal:block tal:repeat="field python: form.get_fields_in_group(group[\'goid\'])">\n
<tal:block metal:use-macro="field_render" />\n
......
929
\ No newline at end of file
931
\ No newline at end of file
......@@ -626,8 +626,8 @@ class TestBPMDummyDeliveryMovementMixin(TestBPMMixin):
self.portal.deleteContent(id='testing_folder')
self.stepTic()
completed_state = 'confirmed'
frozen_state = 'planned'
completed_state = 'delivered'
frozen_state = 'confirmed'
completed_state_list = [completed_state, frozen_state]
frozen_state_list = [frozen_state]
......@@ -641,6 +641,12 @@ class TestBPMDummyDeliveryMovementMixin(TestBPMMixin):
# path which is completed, as soon as related simulation movements are in
# proper state
self.order_path = self.createBusinessPath(business_process,
successor_value = ordered,
trade_phase='default/order',
completed_state_list = self.completed_state_list,
frozen_state_list = self.frozen_state_list)
self.delivery_path = self.createBusinessPath(business_process,
predecessor_value = ordered, successor_value = delivered,
trade_phase='default/delivery',
......@@ -658,6 +664,12 @@ class TestBPMDummyDeliveryMovementMixin(TestBPMMixin):
delivered = self.createBusinessState(business_process)
invoiced = self.createBusinessState(business_process)
self.order_path = self.createBusinessPath(business_process,
successor_value = ordered,
trade_phase='default/order',
completed_state_list = self.completed_state_list,
frozen_state_list = self.frozen_state_list)
self.invoice_path = self.createBusinessPath(business_process,
predecessor_value = ordered, successor_value = invoiced,
trade_phase='default/invoicing',
......@@ -689,12 +701,19 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
causality_value = self.delivery_path
delivery_value = order_line,
causality_value = self.order_path
)
# second level rule with simulation movement
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -702,22 +721,30 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
# split simulation movement for first level applied rule
split_simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement', order_value = order_line,
causality_value = self.delivery_path)
portal_type = 'Simulation Movement', delivery_value = order_line,
causality_value = self.order_path)
# second level rule with simulation movement for split parent movement
split_invoicing_rule = split_simulation_movement.newContent(
split_delivery_rule = split_simulation_movement.newContent(
portal_type='Applied Rule')
split_delivery_simulation_movement = split_delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement for split parent movement
split_invoicing_rule = split_delivery_simulation_movement.newContent(
portal_type='Applied Rule')
split_invoicing_simulation_movement = split_invoicing_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.invoice_path)
order.setSimulationState(self.completed_state)
self.stepTic()
# in the beginning only order related movements shall be buildable
self.assertEquals(self.delivery_path.isBuildable(order), True)
self.assertEquals(simulation_movement.isBuildable(), True)
self.assertEquals(split_simulation_movement.isBuildable(), True)
self.assertEquals(delivery_simulation_movement.isBuildable(), True)
self.assertEquals(split_delivery_simulation_movement.isBuildable(), True)
self.assertEquals(self.invoice_path.isBuildable(order), False)
self.assertEquals(invoicing_simulation_movement.isBuildable(), False)
......@@ -729,7 +756,7 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
delivery_line = self._createMovement(delivery)
# relate not split movement with delivery (deliver it)
simulation_movement.edit(delivery_value = delivery_line)
delivery_simulation_movement.edit(delivery_value = delivery_line)
self.stepTic()
......@@ -742,11 +769,11 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
# delivery_path (for delivery) is not buildable - delivery is already
# built for those movements
self.assertEquals(self.delivery_path.isBuildable(order), True)
self.assertEquals(split_simulation_movement.isBuildable(), True)
self.assertEquals(split_delivery_simulation_movement.isBuildable(), True)
self.assertEquals(self.delivery_path.isBuildable(delivery), False)
self.assertEquals(self.invoice_path.isBuildable(delivery), False)
self.assertEquals(simulation_movement.isBuildable(), False)
self.assertEquals(delivery_simulation_movement.isBuildable(), False)
self.assertEquals(invoicing_simulation_movement.isBuildable(), False)
self.assertEquals(self.invoice_path.isBuildable(order), False)
self.assertEquals(split_invoicing_simulation_movement.isBuildable(),
......@@ -777,7 +804,7 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
self.assertEquals(self.invoice_path.isBuildable(order), True)
self.assertEquals(self.delivery_path.isBuildable(delivery), False)
self.assertEquals(simulation_movement.isBuildable(), False)
self.assertEquals(delivery_simulation_movement.isBuildable(), False)
self.assertEquals(split_invoicing_simulation_movement.isBuildable(),
False)
......@@ -799,20 +826,27 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
causality_value = self.delivery_path
delivery_value = order_line,
causality_value = self.order_path
)
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.invoice_path)
order.setSimulationState(self.completed_state)
self.stepTic()
self.assertEquals(self.delivery_path.isBuildable(order), False)
self.assertEquals(simulation_movement.isBuildable(), False)
self.assertEquals(delivery_simulation_movement.isBuildable(), False)
self.assertEquals(self.invoice_path.isBuildable(order), True)
self.assertEquals(invoicing_simulation_movement.isBuildable(), True)
......@@ -828,7 +862,7 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
self.assertEquals(self.delivery_path.isBuildable(delivery), False)
self.assertEquals(self.invoice_path.isBuildable(delivery), False)
self.assertEquals(simulation_movement.isBuildable(), False)
self.assertEquals(delivery_simulation_movement.isBuildable(), False)
self.assertEquals(invoicing_simulation_movement.isBuildable(), False)
self.assertEquals(self.invoice_path.isBuildable(order), False)
......@@ -846,13 +880,13 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
self.assertEquals(invoicing_simulation_movement.isBuildable(), False)
self.assertEquals(self.invoice_path.isBuildable(delivery), False)
self.assertEquals(self.invoice_path.isBuildable(order), False)
self.assertEquals(simulation_movement.isBuildable(), True)
self.assertEquals(delivery_simulation_movement.isBuildable(), True)
# now simulate compensation
compensated_simulation_movement = applied_rule.newContent(
compensated_simulation_movement = delivery_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
......@@ -868,16 +902,13 @@ class TestBPMisBuildableImplementation(TestBPMDummyDeliveryMovementMixin):
another_delivery = self._createDelivery(causality_value = delivery)
another_delivery_line = self._createMovement(another_delivery)
simulation_movement.edit(delivery_value=another_delivery_line)
delivery_simulation_movement.edit(delivery_value=another_delivery_line)
self.stepTic()
# XXX look at comments in BusinessPath.isBuildable
# in this case expected result if False for delivery_path.isBuildable(order)
self.assertEquals(self.delivery_path.isBuildable(order), True)
self.assertEquals(self.delivery_path.isBuildable(delivery), False)
self.assertEquals(self.delivery_path.isBuildable(order), False)
self.assertEquals(simulation_movement.isBuildable(), False)
self.assertEquals(delivery_simulation_movement.isBuildable(), False)
self.assertEquals(invoicing_simulation_movement.isBuildable(), False)
self.assertEquals(self.invoice_path.isBuildable(order), True)
......@@ -901,12 +932,19 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
causality_value = self.delivery_path
delivery_value = order_line,
causality_value = self.order_path
)
# second level rule with simulation movement
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -914,11 +952,18 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
# split simulation movement for first level applied rule
split_simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement', order_value = order_line,
causality_value = self.delivery_path)
portal_type = 'Simulation Movement', delivery_value = order_line,
causality_value = self.order_path)
# second level rule with simulation movement for split parent movement
split_invoicing_rule = split_simulation_movement.newContent(
split_delivery_rule = split_simulation_movement.newContent(
portal_type='Applied Rule')
split_delivery_simulation_movement = split_delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement for split parent movement
split_invoicing_rule = split_delivery_simulation_movement.newContent(
portal_type='Applied Rule')
split_invoicing_simulation_movement = split_invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -937,7 +982,7 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
delivery_line = self._createMovement(delivery)
# relate not split movement with delivery (deliver it)
simulation_movement.edit(delivery_value = delivery_line)
delivery_simulation_movement.edit(delivery_value = delivery_line)
self.stepTic()
......@@ -988,11 +1033,17 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -1048,9 +1099,9 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
# now simulate compensation
compensated_simulation_movement = applied_rule.newContent(
compensated_simulation_movement = delivery_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
......@@ -1066,7 +1117,7 @@ class TestBPMisCompletedImplementation(TestBPMDummyDeliveryMovementMixin):
another_delivery = self._createDelivery(causality_value = delivery)
another_delivery_line = self._createMovement(another_delivery)
simulation_movement.edit(delivery_value=another_delivery_line)
delivery_simulation_movement.edit(delivery_value=another_delivery_line)
self.stepTic()
......@@ -1097,12 +1148,19 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
# second level rule with simulation movement
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -1110,11 +1168,18 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
# split simulation movement for first level applied rule
split_simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement', order_value = order_line,
causality_value = self.delivery_path)
portal_type = 'Simulation Movement', delivery_value = order_line,
causality_value = self.order_path)
# second level rule with simulation movement for split parent movement
split_invoicing_rule = split_simulation_movement.newContent(
split_delivery_rule = split_simulation_movement.newContent(
portal_type='Applied Rule')
split_delivery_simulation_movement = split_delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
# third level rule with simulation movement for split parent movement
split_invoicing_rule = split_delivery_simulation_movement.newContent(
portal_type='Applied Rule')
split_invoicing_simulation_movement = split_invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -1135,7 +1200,7 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
delivery_line = self._createMovement(delivery)
# relate not split movement with delivery (deliver it)
simulation_movement.edit(delivery_value = delivery_line)
delivery_simulation_movement.edit(delivery_value = delivery_line)
self.stepTic()
......@@ -1163,10 +1228,10 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
self.assertEqual(self.delivery_path.isFrozen(order), False)
self.assertEqual(self.invoice_path.isFrozen(order), False)
self.assertEqual(self.delivery_path.isFrozen(delivery), True)
self.assertEqual(self.delivery_path.isFrozen(delivery), False)
self.assertEqual(self.invoice_path.isFrozen(delivery), False)
self.assertEqual(simulation_movement.isFrozen(), True)
self.assertEqual(delivery_simulation_movement.isFrozen(), True)
self.assertEqual(invoicing_simulation_movement.isFrozen(), False)
self.assertEqual(split_simulation_movement.isFrozen(), False)
self.assertEqual(split_invoicing_simulation_movement.isFrozen(), False)
......@@ -1183,11 +1248,17 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
simulation_movement = applied_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
invoicing_rule = simulation_movement.newContent(
delivery_rule = simulation_movement.newContent(
portal_type='Applied Rule')
delivery_simulation_movement = delivery_rule.newContent(
portal_type='Simulation Movement',
causality_value = self.delivery_path)
invoicing_rule = delivery_simulation_movement.newContent(
portal_type='Applied Rule')
invoicing_simulation_movement = invoicing_rule.newContent(
portal_type='Simulation Movement',
......@@ -1235,9 +1306,9 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
# now simulate compensation
compensated_simulation_movement = applied_rule.newContent(
compensated_simulation_movement = delivery_rule.newContent(
portal_type = 'Simulation Movement',
order_value = order_line,
delivery_value = order_line,
causality_value = self.delivery_path
)
......@@ -1253,7 +1324,7 @@ class TestBPMisFrozenImplementation(TestBPMDummyDeliveryMovementMixin):
another_delivery = self._createDelivery(causality_value = delivery)
another_delivery_line = self._createMovement(another_delivery)
simulation_movement.edit(delivery_value=another_delivery_line)
delivery_simulation_movement.edit(delivery_value=another_delivery_line)
self.stepTic()
......
......@@ -430,28 +430,37 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
def test_Folder_delete_related_object(self):
# deletion is refused if there are related objects
module = self.portal.newContent(portal_type='Folder', id='test_folder')
document_1 = module.newContent(portal_type='Folder', id='1')
document_2 = module.newContent(portal_type='Folder', id='2')
self.portal.portal_categories.setCategoryMembership(
context=document_1,
base_category_list=('source',),
category_list=document_2.getRelativeUrl())
uid_list = [document_1.getUid(), document_2.getUid()]
organisation_module_len = len(self.portal.organisation_module)
person_module_len = len(self.portal.person_module)
organisation = self.portal.organisation_module.newContent()
person = self.portal.person_module.newContent(
default_career_subordination_value=organisation)
for obj in person, organisation:
obj.manage_addLocalRoles(self.manager_username, ['Assignor'])
transaction.commit()
self.assertEqual(0, organisation.getRelationCountForDeletion())
self.tic()
self.assertEqual(2, organisation.getRelationCountForDeletion())
self.assertEqual(0, person.getRelationCountForDeletion())
def delete(assert_deleted, obj):
uid_list = [obj.getUid()]
self.portal.portal_selections.setSelectionParamsFor(
'test_selection', dict(uids=uid_list))
md5_string = md5.new(str(sorted(str(x) for x in uid_list))).hexdigest()
redirect = obj.getParentValue().Folder_delete(uids=uid_list,
selection_name='test_selection', md5_object_uid_list=md5_string)
self.assertTrue(('Sorry, 1 item is in use.', 'Deleted.')[assert_deleted]
in redirect, redirect)
transaction.commit()
self.tic()
self.assertEquals([document_1],
self.portal.portal_categories.getRelatedValueList(document_2))
md5_string = md5.new(str(sorted([str(x) for x in uid_list]))).hexdigest()
redirect = module.Folder_delete(selection_name='test_selection',
uids=uid_list,
md5_object_uid_list=md5_string)
self.assert_('Sorry, 1 item is in use.' in redirect, redirect)
transaction.savepoint(optimistic=True)
self.assertEquals(len(module.objectValues()), 2)
delete(0, organisation)
delete(1, person)
self.assertEqual(0, organisation.getRelationCountForDeletion())
delete(1, organisation)
self.assertEquals(organisation_module_len + 1,
len(self.portal.organisation_module))
self.assertEquals(person_module_len + 1,
len(self.portal.person_module))
def test_Folder_delete_non_accessible_object(self):
# deletion is refused if there are related objects, even if those related
......
......@@ -605,8 +605,10 @@ class TestInvoiceMixin(TestPackingListMixin,
portal_type=self.invoice_portal_type)
self.assertEquals(len(related_invoice_list), 1)
invoice = related_invoice_list[0]
self.assertEquals(packing_list.getSource(), invoice.getSource())
self.assertEquals(packing_list.getDestination(), invoice.getDestination())
self.assertEquals(packing_list.getSourceAdministration(),
invoice.getSource())
self.assertEquals(packing_list.getDestinationAdministration(),
invoice.getDestination())
self.assertEquals(packing_list.getDestinationSection(), \
invoice.getDestinationSection())
self.assertEquals(packing_list.getSourceSection(), \
......
......@@ -564,11 +564,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# but raises KeyError if object is not in catalog
self.assertRaises(KeyError, portal_catalog.getObject, sys.maxint)
def test_getitem(self):
def test_getRecordForUid(self):
portal_catalog = self.getCatalogTool()
obj = self._makeOrganisation()
self.assertEquals(obj,
portal_catalog.getSQLCatalog()[obj.getUid()].getObject())
portal_catalog.getSQLCatalog().getRecordForUid(obj.getUid()).getObject())
def test_path(self):
portal_catalog = self.getCatalogTool()
......
......@@ -76,9 +76,7 @@ def getDocumentGroupByWorkflowStateList(self, form_id='', **kw):
'catalog.%s is not NULL' % workflow_state
params['group_by'] = ('catalog.portal_type',
'catalog.%s' % workflow_state)
params['select_expression'] = (
'catalog.path, count(catalog.uid) as count, catalog.portal_type, catalog.%s'
% workflow_state)
params['select_dict'] = {'count': 'count(catalog.uid)'}
for brain in selection_tool.callSelectionFor(selection_name, params=params):
doc = brain.getObject()
......
......@@ -122,6 +122,10 @@ class TestFloatField(ERP5TypeTestCase):
self.assertEquals('0.01', self.widget.format_value(self.field, 0.011))
# value is rounded
self.assertEquals('0.01', self.widget.format_value(self.field, 0.009999))
self.assertEquals('1.00',
self.widget.format_value(self.field, sum([0.1] * 10)))
self.assertEquals('566.30',
self.widget.format_value(self.field, 281.80 + 54.50 + 230.00))
def test_render_view(self):
self.field.values['input_style'] = '-1 234.5'
......@@ -154,6 +158,7 @@ class TestFloatField(ERP5TypeTestCase):
self.field.values['editable'] = 0
self.assertEquals('10000000000000000000.00',
self.field.render(10000000000000000000))
self.assertEquals('1e+100', self.field.render(1e+100))
def test_validate_thousand_separator_point(self):
self.field.values['input_style'] = '-1 234.5'
......@@ -375,12 +380,15 @@ class TestListField(ERP5TypeTestCase):
"""Create some categories into gender
"""
category_tool = self.portal.portal_categories
category_dict = {'a':1, 'b':2, 'd':3, 'c':4, 'e':None, 'g':None, 'f':None}
if len(category_tool.gender.contentValues()) == 0 :
for category_id, int_index in category_dict.items():
category_tool.gender.newContent(portal_type='Category',
id=category_id,
int_index=int_index)
id='male',
title='Male',
int_index=1)
category_tool.gender.newContent(portal_type='Category',
id='female',
title='Female',
int_index=2)
def test_render_odt(self):
items = [('My first Line', '1'), ('My Second Line', '2')]
......@@ -417,17 +425,15 @@ class TestListField(ERP5TypeTestCase):
category_item_list = field.get_value('items')
self.assertEquals(category_item_list,
[['', ''], ['e', 'e'], ['f', 'f'], ['g', 'g'], ['a', 'a'], ['b', 'b'],
['d', 'd'], ['c', 'c']])
[['', ''], ['Male', 'male'], ['Female', 'female']])
# try on a person to select on gender and check if the result is the same
person_module = self.portal.getDefaultModule('Person')
person = person_module.newContent(portal_type='Person')
person.setGender('b')
self.assertEquals(person.getGender(), 'b')
person.setGender('female')
self.assertEquals(person.getGender(), 'female')
self.assertEquals(person.Person_view.my_gender.get_value('items'),
[['', ''], ['e', 'e'], ['f', 'f'], ['g', 'g'], ['a', 'a'], ['b', 'b'],
['d', 'd'], ['c', 'c']])
[['', ''], ['Male', 'male'], ['Female', 'female']])
class TestMultiListField(ERP5TypeTestCase):
......
......@@ -36,7 +36,7 @@ from AccessControl.SecurityManagement import getSecurityManager
from zExceptions import Unauthorized
from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.testERP5Type import PropertySheetTestCase
from Products.ERP5Form.Document.Preference import Priority
from Products.ERP5.PropertySheet.HtmlStylePreference import HtmlStylePreference
......@@ -45,7 +45,7 @@ default_large_image_height, = [pref.get('default')
if pref['id'] == 'preferred_large_image_height']
class TestPreferences(ERP5TypeTestCase):
class TestPreferences(PropertySheetTestCase):
def getTitle(self):
return "Portal Preferences"
......
......@@ -74,6 +74,19 @@ class InvoicingRule(Rule):
def isDeliverable(self, movement):
return movement.getResource() is not None
def _getExpandablePropertyUpdateDict(self, applied_rule, movement,
business_path, current_property_dict):
"""
In Invoice Simulation Rule, source should be source_administration
of the input movement or its order's source. Same for destination.
"""
root_simulation_movement = movement.getRootSimulationMovement()
source = movement.getSourceAdministration() or \
root_simulation_movement.getSource()
destination = movement.getDestinationAdministration() or \
root_simulation_movement.getDestination()
return {'source':source, 'destination':destination}
security.declareProtected(Permissions.AccessContentsInformation,
'getExpandablePropertyList')
def getExpandablePropertyList(self, default=None):
......
......@@ -387,7 +387,10 @@ class Rule(Predicate, XMLObject):
if movement.isPropertyRecorded(k):
movement_value = movement.getRecordedProperty(k)
if isinstance(movement_value, list) and not isinstance(v, list):
try:
movement_value = movement_value[0]
except IndexError:
movement_value = None
else:
movement_value = movement.getProperty(k)
if k not in ('quantity',) and v != movement_value:
......@@ -507,7 +510,10 @@ class Rule(Predicate, XMLObject):
if movement.isPropertyRecorded(k):
movement_value = movement.getRecordedProperty(k)
if isinstance(movement_value, list) and not isinstance(v, list):
try:
movement_value = movement_value[0]
except IndexError:
movement_value = None
else:
movement_value = movement.getProperty(k)
if v != movement_value:
......
......@@ -62,15 +62,14 @@ class TradeModelRule(Rule):
for amount in trade_condition.getAggregatedAmountList(context_movement):
# business path specific
business_path_list = business_process.getPathValueList(
trade_phase=amount.getTradePhaseList())
if len(business_path_list) == 0:
raise ValueError('Cannot find Business Path')
if len(business_path_list) != 1:
trade_phase=amount.getTradePhaseList(), context=context_movement)
if len(business_path_list) > 1:
raise NotImplementedError('Only one Business Path is supported')
if business_path_list:
business_path = business_path_list[0]
else:
business_path = None
movement_kw = self._getExpandablePropertyDict(applied_rule,
context_movement, business_path)
......
......@@ -1964,8 +1964,10 @@ class TestSaleInvoiceMixin(TestInvoiceMixin,
portal_type=self.invoice_portal_type)
self.assertEquals(len(related_invoice_list), 1)
invoice = related_invoice_list[0]
self.assertEquals(packing_list.getSource(), invoice.getSource())
self.assertEquals(packing_list.getDestination(), invoice.getDestination())
self.assertEquals(packing_list.getSourceAdministration(),
invoice.getSource())
self.assertEquals(packing_list.getDestinationAdministration(),
invoice.getDestination())
self.assertEquals(packing_list.getDestinationSection(), \
invoice.getDestinationSection())
self.assertEquals(packing_list.getSourceSection(), \
......
......@@ -559,6 +559,14 @@ class OOoTemplate(ZopePageTemplate):
else:
ooo = ooo_builder.render(name=self.title or self.id)
if DevelopmentMode:
# Validate XML in development mode
from Products.ERP5OOo.tests.utils import Validator
err_list = Validator().validate(ooo)
if err_list:
LOG('ERP5OOo', PROBLEM,
'Validation of %s failed:\n%s' % (self.getId(), ''.join(err_list)))
format = opts.get('format', request.get('format', None))
if format:
return self._asFormat(ooo, format, request, batch_mode)
......@@ -570,14 +578,6 @@ class OOoTemplate(ZopePageTemplate):
'inline;filename="%s%s"' % (self._getFileName(),
guess_extension(self.content_type) or ''))
if DevelopmentMode:
# Validate XML in development mode
from Products.ERP5OOo.tests.utils import Validator
err_list = Validator().validate(ooo)
if err_list:
LOG('ERP5OOo', PROBLEM,
'Validation of %s failed:\n%s' % (self.getId(), ''.join(err_list)))
return ooo
def om_icons(self):
......
......@@ -48,7 +48,8 @@ class SetSetter(BaseSetter):
def __call__(self, instance, *args, **kw):
if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setValue(self._key, args[0],
value = set(args[0])
instance._setValue(self._key, value,
spec=kw.get('spec',()),
filter=kw.get('filter', None),
portal_type=kw.get('portal_type',()),
......
......@@ -2004,7 +2004,7 @@ class Base( CopyContainer,
# We have been provided a string
path = target
if path.startswith(start_string): path = path[start_string_len:] # Prevent duplicating base category
elif isinstance(target, (tuple, list)):
elif isinstance(target, (tuple, list, set, frozenset)):
# We have been provided a list or tuple
path_list = []
for target_item in target:
......@@ -2817,6 +2817,45 @@ class Base( CopyContainer,
else:
return False
security.declareProtected(Permissions.AccessContentsInformation,
'isDeleted')
def isDeleted(self):
"""Test if the context is in 'deleted' state"""
for wf in self.getPortalObject().portal_workflow.getWorkflowsFor(self):
state = wf._getWorkflowStateOf(self)
if state is not None and state.getId() == 'deleted':
return True
return False
security.declareProtected(Permissions.AccessContentsInformation,
'getRelationCountForDeletion')
def getRelationCountForDeletion(self):
"""Count number of related objects preventing deletion"""
portal = self.getPortalObject()
getRelatedValueList = portal.portal_categories.getRelatedValueList
ignore_list = [x.getPhysicalPath() for x in (
portal.portal_simulation,
portal.portal_trash,
self)]
related_list = [(related.getPhysicalPath(), related)
for o in self.getIndexableChildValueList()
for related in getRelatedValueList(o)]
related_list.sort()
ignored = None
related_count = 0
for related_path, related in related_list:
if ignored is None or related_path[:len(ignored)] != ignored:
for ignored in ignore_list:
if related_path[:len(ignored)] == ignored:
break
else:
if related.isDeleted():
ignored = related_path
else:
ignored = None
related_count += 1
return related_count
# Workflow Related Method
security.declarePublic('getWorkflowStateItemList')
def getWorkflowStateItemList(self):
......@@ -3640,7 +3679,7 @@ class Base( CopyContainer,
continue
seen_properties.append(property)
subdochelper = newTempDocumentationHelper(dochelper, k,
title=property['id'], description=property['description'],
title=property['id'], description=property.get('description', ''),
type=property['type'], security=property['mode'],
content=pformat(documented_item.getProperty(property['id'])))
subdochelper_dynamic_accessor_list = []
......
......@@ -191,19 +191,30 @@ if 'SOFTWARE_HOME' in os.environ:
# software_home is zope_home/lib/python, remove lib/python
zope_home = os.path.split(os.path.split(software_home)[0])[0]
else:
common_paths = [
'/usr/lib/erp5/lib/python',
'/usr/lib64/zope/lib/python',
'/usr/lib/zope2.8/lib/python',
'/usr/lib/zope/lib/python',
]
# maybe SOFTWARE_HOME is already in sys.path
try:
import Zope2
except ImportError:
pass
else:
common_paths.insert(0, os.path.dirname(os.path.dirname(Zope2.__file__)))
if WIN:
erp5_home = os.path.sep.join(
tests_framework_home.split(os.path.sep)[:-4])
zope_home = os.path.join(erp5_home, 'Zope')
elif os.path.isdir('/usr/lib/erp5/lib/python'):
zope_home = '/usr/lib/erp5'
elif os.path.isdir('/usr/lib64/zope/lib/python'):
zope_home = '/usr/lib64/zope'
elif os.path.isdir('/usr/lib/zope2.8/lib/python'):
zope_home = '/usr/lib/zope2.8'
common_paths.insert(0, os.path.join(erp5_home, 'Zope', 'lib', 'python'))
for software_home in common_paths:
if os.path.isdir(software_home):
break
else:
zope_home = '/usr/lib/zope'
software_home = os.path.join(zope_home, 'lib', 'python')
sys.exit('No Zope2 software_home found')
zope_home = os.path.dirname(os.path.dirname(software_home))
os.environ['SOFTWARE_HOME'] = software_home
# SOFTWARE_HOME must be early in sys.path, otherwise some products will
......
......@@ -675,6 +675,7 @@ class TestPropertySheet:
person.setRegionValueList([alpha, alpha])
self.assertEquals(person.getRegionList(), ['alpha', 'alpha'])
person.setRegionValueSet([alpha, alpha])
self.assertEquals(person.getRegionList(), ['alpha'])
self.assertEquals(person.getRegionSet(), ['alpha'])
person.setRegionValueList([alpha, beta, alpha])
self.assertEquals(person.getRegionList(), ['alpha', 'beta', 'alpha'])
......@@ -2340,6 +2341,7 @@ class TestPropertySheet:
"""
if not run: return
folder = self.getOrganisationModule()
sql_catalog = self.portal.portal_catalog.getSQLCatalog()
initial_id = 'foo'
final_id = 'bar'
subdocument_id = 'sub'
......@@ -2353,8 +2355,8 @@ class TestPropertySheet:
self.tic()
folder = self.getOrganisationModule()
subdocument = folder[final_id][subdocument_id]
subdocument_catalogged_path = self.getPortalObject().portal_catalog.getSQLCatalog()[subdocument.uid].path
self.assertEqual(subdocument.getPath(), subdocument_catalogged_path)
subdocument_record = sql_catalog.getRecordForUid(subdocument.uid)
self.assertEqual(subdocument.getPath(), subdocument_record.path)
def test_getCreationDate(self, quiet=quiet, run=run_all_test):
"""
......
......@@ -1649,11 +1649,17 @@ class FloatWidget(TextWidget):
try :
float_value = float(value)
if precision not in (None, ''):
float_value = round(float_value, precision)
# we use repr that have a better precision than str
# if we have a precision, then use it now
value = ('%%0.%sf' % precision) % float_value
else:
# if no precision, we use repr which have a better precision than str
value = repr(float_value)
except ValueError:
return value
# if this number displayed in scientific notification, just return it as
# is
if 'e' in value:
return value
value_list = value.split('.')
integer = value_list[0]
......
......@@ -406,8 +406,8 @@ class DB(TM):
self.db.query(query)
except ProgrammingError, exception:
LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,))
if exception[0] == 1064:
# 1064 = You have an error in your SQL syntax
if exception[0] == ER.PARSE_ERROR:
# You have an error in your SQL syntax
# Replace MySQL brain dead error message with a more meaningful
# one. (MySQL only reports the SQL query *from* the error place,
# which strips important contextual information).
......
......@@ -115,6 +115,9 @@ class EntireQuery(object):
for alias, raw_column in self.select_dict.iteritems():
if raw_column is None:
column = alias
if '.' in alias:
# If given column is pre-mapped, strip table name from its alias.
_, alias = alias.replace('`', '').split('.')
else:
column = raw_column
try:
......
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2006-2009 Nexedi SA and Contributors. All Rights Reserved.
......@@ -217,8 +218,8 @@ class TestSQLCatalog(unittest.TestCase):
'Query: %r\nSearchText: %r\nReference: %r\nSecond rendering: %r' % \
(query, search_text, reference_param_dict, search_text_param_dict))
def asSQLExpression(self, kw):
entire_query = self._catalog.buildEntireQuery(kw)
def asSQLExpression(self, kw, **build_entire_query_kw):
entire_query = self._catalog.buildEntireQuery(kw, **build_entire_query_kw)
return entire_query.asSQLExpression(self._catalog, False)
def _testDefaultKey(self, column):
......@@ -549,6 +550,25 @@ class TestSQLCatalog(unittest.TestCase):
select_dict = sql_expression.getSelectDict()
self.assertTrue('ambiguous_mapping' in select_dict, select_dict)
self.assertTrue('bar' in select_dict['ambiguous_mapping'], select_dict['ambiguous_mapping'])
# Doted alias: table name must get stripped. This is required to have an
# upgrade path from old ZSQLCatalog versions where pre-mapped columns were
# used in their select_expression. This must only happen in the
# "{column: None}" form, as otherwise it's the user explicitely asking for
# such alias (which is not strictly invalid).
sql_expression = self.asSQLExpression({'select_dict': {
'foo.default': None,
'foo.keyword': 'foo.keyword',
}}, query_table='foo')
select_dict = sql_expression.getSelectDict()
self.assertTrue('default' in select_dict, select_dict)
self.assertFalse('foo.default' in select_dict, select_dict)
self.assertTrue('foo.keyword' in select_dict, select_dict)
# Variant: same operation, but this time stripping generates an ambiguity.
# That must be detected and cause a mapping exception.
self.assertRaises(ValueError, self.asSQLExpression, {'select_dict': {
'foo.ambiguous_mapping': None,
'bar.ambiguous_mapping': None,
}}, query_table='foo')
def test_hasColumn(self):
self.assertTrue(self._catalog.hasColumn('uid'))
......
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