Commit 7da3d912 authored by Rafael Monnerat's avatar Rafael Monnerat

Update from upstream/master

parents 1dc2e88d 9805e260
Pipeline #33611 failed with stage
in 0 seconds
......@@ -72,4 +72,6 @@ for item_value in value_list:
sub_field_dict[item_key]['value'] = item_value
# Return the list of subfield configuration.
return sub_field_dict.values()
return sorted(
sub_field_dict.values(),
key=lambda v: v['title'])
......@@ -90,23 +90,22 @@ Test Account GAP Parallel listfield.
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_0']//label[@for='subfield_field_my_gap_list_my_country/my_accounting_standards' and text()='GAP - My Accounting Standards']</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_0']//label[@for='subfield_field_my_gap_list_another_country/another_standards' and text()='GAP - Another Standards']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_0']//p[text()='1 - Equity Accounts']</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_0']//p[text()='1 - Dummy Account']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_1']//label[@for='subfield_field_my_gap_list_another_country/another_standards' and text()='GAP - Another Standards']</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_1']//label[@for='subfield_field_my_gap_list_my_country/my_accounting_standards' and text()='GAP - My Accounting Standards']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_1']//p[text()='1 - Dummy Account']</td>
<td>//div[@data-gadget-scope='field_my_gap_list']//div[@data-gadget-scope='PARALLEL_SUB_FIELD_1']//p[text()='1 - Equity Accounts']</td>
<td></td>
</tr>
......
......@@ -305,7 +305,8 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement = delivery_applied_rule.contentValues()[0]
invoice_applied_rule = delivery_movement.contentValues()[0]
invoice_movement = invoice_applied_rule.contentValues()[0]
invoice_transaction_applied_rule = invoice_movement.contentValues()[0]
invoice_transaction_applied_rule = [x for x in invoice_movement.contentValues() \
if x.getSpecialiseReference() == 'default_invoice_transaction_rule'][0]
invoice_transaction_movement_1 =\
invoice_transaction_applied_rule.contentValues()[0]
self.assertEqual(currency,
......@@ -397,7 +398,8 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement = delivery_applied_rule.contentValues()[0]
invoice_applied_rule = delivery_movement.contentValues()[0]
invoice_movement = invoice_applied_rule.contentValues()[0]
invoice_transaction_applied_rule = invoice_movement.contentValues()[0]
invoice_transaction_applied_rule = [x for x in invoice_movement.contentValues() \
if x.getSpecialiseReference() == 'default_invoice_transaction_rule'][0]
invoice_transaction_movement =\
invoice_transaction_applied_rule.contentValues()[0]
self.assertEqual(currency,
......@@ -684,7 +686,8 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement = delivery_applied_rule.contentValues()[0]
invoice_applied_rule = delivery_movement.contentValues()[0]
invoice_movement = invoice_applied_rule.contentValues()[0]
invoice_transaction_applied_rule = invoice_movement.contentValues()[0]
invoice_transaction_applied_rule = [x for x in invoice_movement.contentValues() \
if x.getSpecialiseReference() == 'default_invoice_transaction_rule'][0]
result_list = []
for invoice_transaction_movement in invoice_transaction_applied_rule.contentValues():
result_list.append((invoice_transaction_movement.getSource(), invoice_transaction_movement.getDestinationTotalAssetPrice()))
......@@ -788,7 +791,8 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement = delivery_applied_rule.contentValues()[0]
invoice_applied_rule = delivery_movement.contentValues()[0]
invoice_movement = invoice_applied_rule.contentValues()[0]
invoice_transaction_applied_rule = invoice_movement.contentValues()[0]
invoice_transaction_applied_rule = [x for x in invoice_movement.contentValues() \
if x.getSpecialiseReference() == 'default_invoice_transaction_rule'][0]
result_list = []
for invoice_transaction_movement in invoice_transaction_applied_rule.contentValues():
result_list.append((invoice_transaction_movement.getSource(), invoice_transaction_movement.getSourceTotalAssetPrice()))
......
......@@ -581,12 +581,24 @@ class TestCurrencyExchangeCell(CurrencyExchangeTestCase):
euro_to_usd.setPriceCurrencyValue(usd)
self.assertEqual(2, len(euro_to_usd.contentValues()))
# cell range is like this:
self.assertEqual([
['currency_exchange_type/type_a', 'currency_exchange_type/type_b'],
['resource/%s' % euro.getRelativeUrl()],
['price_currency/%s' % usd.getRelativeUrl()],
], euro_to_usd.getCellRange(base_id='path'))
# cell range is like this, matrix cell range does not have ordering
# of the keys, only asCellRange script has.
self.assertEqual(
euro_to_usd.CurrencyExchangeLine_asCellRange(base_id='path'),
(
['currency_exchange_type/type_a', 'currency_exchange_type/type_b'],
['resource/%s' % euro.getRelativeUrl()],
['price_currency/%s' % usd.getRelativeUrl()],
)
)
self.assertEqual(
[sorted(r) for r in euro_to_usd.getCellRange(base_id='path')],
[
['currency_exchange_type/type_a', 'currency_exchange_type/type_b'],
['resource/%s' % euro.getRelativeUrl()],
['price_currency/%s' % usd.getRelativeUrl()],
]
)
type_a_cell = euro_to_usd.getCell(
'currency_exchange_type/type_a',
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,13 +37,7 @@ class BaseVariantMovementGroup(MovementGroup):
portal_type = 'Base Variant Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
category_list = movement.getVariationBaseCategoryList()
if category_list is None:
category_list = []
category_list.sort()
property_dict['_base_category_list'] = category_list
return property_dict
return {'_base_category_list': sorted(movement.getVariationBaseCategoryList() or [])}
def test(self, document, property_dict, **kw):
# This movement group does not affect updating.
......
......@@ -25,6 +25,7 @@
#
##############################################################################
from collections import OrderedDict
from erp5.component.document.PropertyMovementGroup import PropertyMovementGroup
class CategoryMovementGroup(PropertyMovementGroup):
......@@ -43,7 +44,7 @@ class CategoryMovementGroup(PropertyMovementGroup):
portal_type = 'Category Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
property_dict = OrderedDict()
getProperty = movement.getProperty
for prop in self.getTestedPropertyList():
list_prop = prop + '_list'
......
......@@ -38,10 +38,7 @@ class CausalityMovementGroup(MovementGroup):
def _getPropertyDict(self, movement, **kw):
property_dict = {}
explanation_relative_url = self._getExplanationRelativeUrl(movement)
property_dict['_explanation'] = explanation_relative_url
return property_dict
return {'_explanation': self._getExplanationRelativeUrl(movement)}
def test(self, movement, property_dict, **kw):
# we don't care the difference of explanation url when updating
......
......@@ -26,6 +26,7 @@
#
##############################################################################
from collections import OrderedDict
from erp5.component.document.MovementGroup import MovementGroup
from DateTime import DateTime
from erp5.component.module.DateUtils import atTheEndOfPeriod
......@@ -45,7 +46,7 @@ class MonthlyRangeMovementGroup(MovementGroup):
def _getPropertyDict(self, movement, **kw):
"""Gather start_date and stop_date, converge them to the end of month.
"""
property_dict = {}
property_dict = OrderedDict()
for property_name in self.getTestedPropertyList() or ('start_date', 'stop_date'):
date = movement.getProperty(property_name, None)
if date is not None:
......
......@@ -25,6 +25,7 @@
#
##############################################################################
from collections import OrderedDict
from erp5.component.document.PropertyMovementGroup import PropertyMovementGroup
from Products.ERP5Type.Utils import UpperCase
......@@ -41,7 +42,7 @@ class ParentDeliveryPropertyMovementGroup(PropertyMovementGroup):
portal_type = 'Parent Delivery Property Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
property_dict = OrderedDict()
parent_delivery = self._getParentDelivery(movement)
if parent_delivery is not None:
for prop in self.getTestedPropertyList():
......
......@@ -40,10 +40,7 @@ class ParentExplanationMovementGroup(MovementGroup):
portal_type = 'Parent Explanation Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
parent_explanation_value = movement.getParentExplanationValue()
property_dict['parent_explanation_value'] = parent_explanation_value
return property_dict
return {'parent_explanation_value': movement.getParentExplanationValue()}
def test(self, document, property_dict, **kw):
if document.getParentExplanationValue() == \
......
......@@ -26,8 +26,10 @@
#
##############################################################################
from collections import OrderedDict
from erp5.component.document.MovementGroup import MovementGroup
class PropertyMovementGroup(MovementGroup):
"""
The purpose of MovementGroup is to define how movements are grouped,
......@@ -40,7 +42,7 @@ class PropertyMovementGroup(MovementGroup):
portal_type = 'Property Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
property_dict = OrderedDict()
getProperty = movement.getProperty
for prop in self.getTestedPropertyList():
property_dict[prop] = getProperty(prop)
......
......@@ -36,7 +36,7 @@ class RequirementMovementGroup(MovementGroup):
portal_type = 'Requirement Movement Group'
def _getPropertyDict(self, movement, **kw):
return {'requirement':self._getRequirementList(movement)}
return {'requirement': self._getRequirementList(movement)}
def test(self, movement, property_dict, **kw):
# We can always update
......
......@@ -39,10 +39,7 @@ class RootAppliedRuleCausalityMovementGroup(MovementGroup):
portal_type = 'Root Applied Rule Causality Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
root_causality_value = self._getRootCausalityValue(movement)
property_dict['root_causality_value_list'] = [root_causality_value]
return property_dict
return {'root_causality_value_list': [self._getRootCausalityValue(movement)]}
def test(self, movement, property_dict, **kw):
# We can always update
......
......@@ -37,9 +37,7 @@ class TitleMovementGroup(MovementGroup):
portal_type = 'Title Movement Group'
def _getPropertyDict(self, movement, **kw):
property_dict = {}
property_dict['title'] = self._getTitle(movement)
return property_dict
return {'title': self._getTitle(movement)}
def test(self, document, property_dict, **kw):
# If title is different, we want to update existing document instead
......
......@@ -331,8 +331,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# 'variation_category' or 'variation_property' pseudo properties,
# which rely on the resource being set to discover which
# categories/properties to set
# XXX-Leo: in the future: using an ordered_dict would be nice,
# but this would have to be respected on Base._edit()
edit_order = []
property_dict = {'edit_order': edit_order}
for d in property_dict_list:
......
currency_exchange_type_list = context.portal_categories.currency_exchange_type.getCategoryChildRelativeUrlList()
currency_exchange_type_list = context.portal_categories.currency_exchange_type.getCategoryChildRelativeUrlList(
local_sort_id=("int_index", "title"))
resource_list = ['resource/%s' % context.getParentValue().getRelativeUrl()]
price_currency_list = [context.getPriceCurrency(base=True)]
......
......@@ -10,7 +10,7 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/movement_resource_interaction_workflow/script_Movement_copyBaseContributionFromResource</string>
<string>after_script/portal_workflow/movement_resource_interaction_workflow/script_Movement_copyCategoryListFromResource</string>
</tuple>
</value>
</item>
......@@ -22,7 +22,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_setBaseContribution</string> </value>
<value> <string>interaction_setResource</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Movement_copyBaseContributionFromResource</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,6 +2,22 @@ movement = state_change['object']
resource = movement.getResourceValue()
if resource is not None:
# quantity unit can be acquired from resource (see Amount.getQuantityUnit)
# we check that it's really set on the movement.
if movement.hasQuantityUnit():
# if the movement already have a quantity unit which is valid for this resource, don't change it
if movement.getQuantityUnit() not in resource.getQuantityUnitList():
movement.setQuantityUnit(resource.getDefaultQuantityUnit())
else:
# initialise to the default quantity unit
movement.setQuantityUnit(resource.getDefaultQuantityUnit())
# if the movement already have a use which is valid for this resource, don't change it.
# ( unlike quantity unit, use is not acquired )
if movement.getUse() not in resource.getUseList():
# otherwise initialise to the default use
movement.setUse(resource.getDefaultUse())
# We can over-write base contribution list always.
# Because when we change the resource, we need to set all the base contribution into movement.
# Imagine that we buy a product which have complex tax definitions with discounting.
......
......@@ -60,9 +60,15 @@
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Movement_copyQuantityUnitFromResource</string> </value>
<value> <string>script_Movement_copyCategoryListFromResource</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
movement = state_change['object']
resource = movement.getResourceValue()
if resource is not None:
# quantity unit can be acquired from resource.
# (Amount class has getQuantityUnit method for backward compatibility and it tries to acquire value from resource).
if movement.hasCategory('quantity_unit'):
# if the movement already have a quantity unit which is valid for this resource, don't change it
movement_quantity_unit = movement.getQuantityUnit()
if movement_quantity_unit and movement_quantity_unit in resource.getQuantityUnitList():
return
# otherwise initialise to the default quantity unit
movement.setQuantityUnit(resource.getDefaultQuantityUnit())
movement = state_change['object']
resource = movement.getResourceValue()
if resource is not None:
# if the movement already have a use which is valid for this resource, don't change it
movement_use = movement.getUse()
if movement_use and movement_use in resource.getUseList():
return
# otherwise initialise to the default use
movement.setUse(resource.getDefaultUse())
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -28,6 +28,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Form.AudioField import AudioField
from Products.ERP5Type.tests.utils import canonical_html
class TestAudioField(ERP5TypeTestCase):
......@@ -44,9 +45,10 @@ class TestAudioField(ERP5TypeTestCase):
def test_render_view(self):
self.field.values['default'] = 'Audio content'
self.assertEqual('<audio preload="preload" src="Audio content" ' +
'controls="controls" >Your browser does not ' +
'support audio tag.</audio>', self.field.render_view(value='Audio content'))
self.assertEqual(
canonical_html(self.field.render_view(value='Audio content')),
'<audio controls="controls" preload="preload" src="Audio content"'
+ '>Your browser does not support audio tag.</audio>',)
self.field.values['audio_preload'] = False
self.field.values['audio_loop'] = True
......@@ -54,13 +56,7 @@ class TestAudioField(ERP5TypeTestCase):
self.field.values['audio_autoplay'] = True
self.field.values['audio_error_message'] = 'Another error message'
self.assertEqual('<audio src="Another Audio content" ' +
'loop="loop" autoplay="autoplay" >Another error ' +
'message</audio>', self.field.render_view(value='Another Audio content'))
import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestAudioField))
return suite
self.assertEqual(
canonical_html(self.field.render_view(value='Another Audio content')),
'<audio autoplay="autoplay" loop="loop" src="Another Audio content"'
+ '>Another error message</audio>')
......@@ -368,13 +368,9 @@ return result
py_script_obj = getattr(portal, python_script_id)
py_script_params = "value=10000, long_parameter=''"
py_script_body = """
import time
def veryExpensiveMethod(value):
# do something expensive for some time
# no 'time.sleep()' available in Zope
# so concatenate strings
s = ''
for i in range(0, value):
s = str(value * value * value) + s
time.sleep(1)
return value
veryExpensiveMethod(value)
......
......@@ -27,6 +27,7 @@
#
##############################################################################
import collections
import pprint
import httplib
import urlparse
......@@ -206,9 +207,15 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
actions = self.portal.portal_actions.listFilteredActionsFor(target)
got = {}
for category, actions in actions.items():
actions_by_priority = collections.defaultdict(list)
got[category] = [dict(title=action['title'], id=action['id'])
for action in actions
if action['visible']]
for action in actions:
actions_by_priority[action['priority']].append(actions)
for actions in actions_by_priority.values():
if len(actions) > 1:
self.assertFalse(actions) # no actions with same priority
msg = ("Actions do not match. Expected:\n%s\n\nGot:\n%s\n" %
(pprint.pformat(expected), pprint.pformat(got)))
self.assertEqual(expected, got, msg)
......@@ -222,8 +229,6 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
'id': 'category_tool'},
{'title': 'Manage Callables',
'id': 'callable_tool'},
{'title': 'Create Module',
'id': 'create_module'},
{'title': 'Configure Portal Types',
'id': 'types_tool'},
{'id': 'property_sheet_tool',
......@@ -232,7 +237,9 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
'title': 'Configure Portal Catalog'},
{'id': 'portal_alarms_action',
'title': 'Configure Alarms'},
{'title': 'Undo', 'id': 'undo'}],
{'title': 'Undo', 'id': 'undo'},
{'title': 'Create Module',
'id': 'create_module'},],
'object': [],
'object_action': [{'id': 'diff_object_action', 'title': 'Diff Object'}],
'object_exchange': [{'id': 'csv_export', 'title': 'Export Csv File'}, # erp5_csv_style
......
......@@ -740,7 +740,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# the list.
self.assertEqual(person.getDefaultRegion(), 'beta')
person.setRegionSet(['alpha', 'beta', 'alpha'])
self.assertEqual(person.getRegionList(), ['beta', 'alpha'])
self.assertEqual(sorted(person.getRegionList()), ['alpha', 'beta'])
# calling a set setter did not change the default region
self.assertEqual(person.getDefaultRegion(), 'beta')
......@@ -2185,6 +2185,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
checked_permission=checked_permission)
self.assertSameSet([beta_path, gamma_path], foo.getRegionList())
foo.setRegionList([beta_path])
foo.setRegionSet([gamma_path, beta_path])
self.assertEqual(foo.getRegionList(), [beta_path, gamma_path])
foo.setRegionValue(None)
self.assertEqual(None, foo.getRegion())
# Check setCategoryValueSet accessor
......@@ -2199,6 +2203,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
checked_permission=checked_permission)
self.assertSameSet([beta_path, gamma_path], foo.getRegionList())
foo.setRegionValueList([beta])
foo.setRegionValueSet([gamma, beta])
self.assertEqual(foo.getRegionValueList(), [beta, gamma])
# check hasCategory accessors
foo.setRegionValue(None)
self.assertEqual(None, foo.getRegion())
......@@ -2385,6 +2393,18 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.assertEqual('Could not get object region/gamma',
logged_errors[0].getMessage())
def test_portal_type_property_sheet_have_priority_over_class_property_sheet(self):
self._addProperty(
'Person',
self.id(),
'first_name',
elementary_type='string',
property_default='string:property sheet default',
portal_type='Standard Property',
)
obj = self.getPersonModule().newContent(portal_type='Person')
self.assertEqual(obj.getFirstName(), 'property sheet default')
def test_list_accessors(self):
self._addProperty('Person', 'test_list_accessors', 'dummy',
elementary_type='lines',
......@@ -2406,12 +2426,23 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
person.setDummyList(['a', 'b'])
self.assertEqual(person.getDummy(), 'a')
self.assertEqual(person.getDummyList(), ['a', 'b'])
self.assertEqual(person.getDummySet(), ['a', 'b'])
self.assertEqual(sorted(person.getDummySet()), ['a', 'b'])
person.setDummySet(['b', 'a', 'c'])
self.assertEqual(person.getDummy(), 'a')
self.assertEqual(sorted(person.getDummyList()), ['a', 'b', 'c'])
person.setDummySet(['b', 'c'])
self.assertEqual(sorted(person.getDummyList()), ['b', 'c'])
person.setDummyList(['a', 'b', 'b'])
self.assertEqual(person.getDummy(), 'a')
self.assertEqual(person.getDummyList(), ['a', 'b', 'b'])
self.assertEqual(sorted(person.getDummySet()), ['a', 'b'])
person.setDummy('value')
self.assertEqual(person.getDummy(), 'value')
self.assertEqual(person.getDummyList(), ['value'])
self.assertEqual(person.getDummySet(), ['value'])
self.assertEqual(sorted(person.getDummySet()), ['value'])
def test_translated_accessors(self):
self._addProperty('Person',
......@@ -3335,6 +3366,13 @@ def test_suite():
pass
else:
import ZPublisher.tests.test_WSGIPublisher
# TestLoadApp tests are confused because running as a live test interfere with
# transaction system. Aborting the transaction at beginning of test seems OK.
TestLoadApp_setUp = ZPublisher.tests.test_WSGIPublisher.TestLoadApp.setUp
def setUp(self):
TestLoadApp_setUp(self)
transaction.abort()
ZPublisher.tests.test_WSGIPublisher.TestLoadApp.setUp = setUp
add_tests(suite, ZPublisher.tests.test_WSGIPublisher)
import ZPublisher.tests.test_mapply
......
......@@ -45,7 +45,7 @@ from Products.ERP5Form.CaptchaField import CaptchaField
from Products.ERP5Form.EditorField import EditorField
from Products.Formulator.MethodField import Method
from Products.Formulator.TALESField import TALESMethod
from Products.ERP5Type.tests.utils import canonical_html
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Form.Form import field_value_cache
from Products.ERP5Form.Form import getFieldValue
......@@ -1180,8 +1180,11 @@ class TestCaptchaField(ERP5TypeTestCase):
def test_numeric_good_captcha(self):
self.field.values['captcha_type'] = 'numeric'
def random_choice(seq):
self.assertIn('+', seq)
return '+'
with mock.patch('Products.ERP5Form.CaptchaField.random.randint', return_value=1), \
mock.patch('Products.ERP5Form.CaptchaField.random.choice', side_effect=lambda seq: seq[0]):
mock.patch('Products.ERP5Form.CaptchaField.random.choice', side_effect=random_choice):
field_html = self.field.render(REQUEST=self.portal.REQUEST)
self.assertIn('1 plus 1', field_html)
self.assertIn(hashlib.md5(b'1 + 1').hexdigest(), field_html)
......@@ -1197,8 +1200,11 @@ class TestCaptchaField(ERP5TypeTestCase):
def test_numeric_bad_captcha(self):
self.field.values['captcha_type'] = 'numeric'
def random_choice(seq):
self.assertIn('+', seq)
return '+'
with mock.patch('Products.ERP5Form.CaptchaField.random.randint', return_value=1), \
mock.patch('Products.ERP5Form.CaptchaField.random.choice', side_effect=lambda seq: seq[0]):
mock.patch('Products.ERP5Form.CaptchaField.random.choice', side_effect=random_choice):
self.field.render(REQUEST=self.portal.REQUEST)
self.assertRaises(
ValidationError, self.validator.validate, self.field, 'field_test', {
......@@ -1269,8 +1275,8 @@ class TestEditorField(ERP5TypeTestCase):
def test_render_editable_textarea(self):
self.field.values['default'] = 'value'
self.assertEqual(
self.field.render(REQUEST=self.portal.REQUEST),
'<textarea rows="5" cols="40" name="field_test_field" >\nvalue</textarea>')
canonical_html(self.field.render(REQUEST=self.portal.REQUEST)),
'<textarea cols="40" name="field_test_field" rows="5">\nvalue</textarea>')
def test_render_editable_textarea_REQUEST(self):
self.field.values['default'] = 'default value'
......@@ -1279,8 +1285,8 @@ class TestEditorField(ERP5TypeTestCase):
self.field.generate_field_key(key=self.field.id)
] = 'user <value>'
self.assertEqual(
self.field.render(REQUEST=self.portal.REQUEST),
'<textarea rows="5" cols="40" name="field_test_field" >\nuser &lt;value&gt;</textarea>')
canonical_html(self.field.render(REQUEST=self.portal.REQUEST)),
'<textarea cols="40" name="field_test_field" rows="5">\nuser &lt;value&gt;</textarea>')
def test_render_non_editable_textarea(self):
self.field.values['default'] = '<not &scaped'
......
......@@ -28,6 +28,8 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Form.VideoField import VideoField
from Products.ERP5Type.tests.utils import canonical_html
class TestVideoField(ERP5TypeTestCase):
"""Tests Video field
......@@ -43,8 +45,11 @@ class TestVideoField(ERP5TypeTestCase):
def test_render_view(self):
self.field.values['default'] = 'Video content'
self.assertEqual('<video preload="auto" src="Video content" controls="controls" height="85" width="160" >Your browser does not support video tag.</video>', \
self.field.render_view(value='Video content'))
self.assertEqual(
canonical_html(self.field.render_view(value='Video content')),
'<video controls="controls" height="85" preload="auto" src="Video content"'
+ ' width="160">Your browser does not support video tag.</video>',
)
self.field.values['video_preload'] = False
self.field.values['video_loop'] = True
......@@ -54,14 +59,9 @@ class TestVideoField(ERP5TypeTestCase):
self.field.values['video_height'] = 800
self.field.values['video_width'] = 1280
self.assertEqual('<video src="Another Video content" ' +
'height="800" width="1280" loop="loop" autoplay="autoplay" ' +
'>Another error message</video>', \
self.field.render_view(value='Another Video content'))
import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVideoField))
return suite
self.assertEqual(
canonical_html(self.field.render_view(value='Another Video content')),
'<video autoplay="autoplay" height="800" loop="loop"'
+ ' src="Another Video content" width="1280">Another error message</video>'
)
......@@ -255,6 +255,34 @@ class TestWorklist(TestWorkflowMixin):
self.worklist_int_variable_id,
])
def test_edit_worklist_view(self):
"""Checks we can view and edit worklist.
"""
def check_visible(worklist):
self.clearCache()
worklist.view()
workflow_value = self.getWorkflowTool()[self.checked_workflow]
# edit reference first
worklist_value = workflow_value.newContent(portal_type='Worklist')
check_visible(worklist_value)
worklist_value.setReference(self.worklist_assignor_id)
check_visible(worklist_value)
worklist_value.setActionName('Test (%(count)s)')
worklist_value.setAction('/')
worklist_value.setActionType('global')
check_visible(worklist_value)
# edit reference last
worklist_value = workflow_value.newContent(portal_type='Worklist')
check_visible(worklist_value)
worklist_value.setActionName('Test (%(count)s)')
worklist_value.setAction('/')
worklist_value.setActionType('global')
check_visible(worklist_value)
worklist_value.setReference(self.worklist_owner_id)
check_visible(worklist_value)
def test_01_permission(self, quiet=0, run=run_all_test):
"""
Test the permission of the building module.
......
import json
return ['test report %s' % json.dumps(kw)]
return ['test report %s' % json.dumps(kw, sort_keys=True)]
......@@ -206,11 +206,11 @@ class TestCorporateIdentityMethod(ERP5TypeTestCase):
# it has no matter with/without follow up
doc_content = '<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&amp;test=23"></a> </div>'
output =web_page_with_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, '<div> test report {"test": "23", "document_language": null, "format": null} </div>')
self.assertEqual(output, '<div> test report {"document_language": null, "format": null, "test": "23"} </div>')
doc_content = '<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&amp;test=23"></a> </div>'
output =web_page_no_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, '<div> test report {"test": "23", "document_language": null, "format": null} </div>')
self.assertEqual(output, '<div> test report {"document_language": null, "format": null, "test": "23"} </div>')
def test_getTemplateProxyParameter_override_person(self):
output_dict_list = self.test_person.Base_getTemplateProxyParameter(
......
......@@ -392,39 +392,37 @@ import sys
Test the fucntioning of the ERP5ImageProcessor and the custom system
display hook too.
"""
self.image_module = self.portal.getDefaultModule('Image')
self.assertTrue(self.image_module is not None)
# Create a new ERP5 image object
reference = 'testBase_displayImageReference5'
data_template = '<img src="data:application/unknown;base64,%s" /><br />'
data = 'qwertyuiopasdfghjklzxcvbnm<somerandomcharacterstosaveasimagedata>'
if getattr(self.image_module, 'testBase_displayImageID5', None) is not None:
self.image_module.manage_delObjects(ids=['testBase_displayImageID5'])
self.image_module.newContent(
data_template = '<img src="data:image/png;base64,%s"'
data = bytes(self.portal.restrictedTraverse('images/erp5_logo.png').data)
img = self.portal.image_module.newContent(
portal_type='Image',
id='testBase_displayImageID5',
id=self.id(),
reference=reference,
data=data,
filename='test.png'
)
)
def cleanup():
self.portal.image_module.manage_delObjects(ids=[img.getId()])
self.tic()
self.addCleanup(cleanup)
self.tic()
# Call Base_displayImage from inside of Base_runJupyter
jupyter_code = """
image = context.portal_catalog.getResultValue(portal_type='Image',reference='%s')
context.Base_renderAsHtml(image)
"""%reference
""" % reference
notebook_context = {'setup' : {}, 'variables' : {}}
notebook_context = {'setup': {}, 'variables': {}}
result = self.portal.Base_runJupyter(
jupyter_code=jupyter_code,
old_notebook_context=notebook_context
)
self.assertIn((data_template % base64.b64encode(data)), result['result_string'])
# Mime_type shouldn't be image/png just because of filename, instead it is
# dependent on file and file data
self.assertNotEqual(result['mime_type'], 'image/png')
)
self.assertIn((data_template % base64.b64encode(data).decode()), result['result_string'])
self.assertEqual(result['mime_type'], 'text/html')
self.assertEqual(result['status'], 'ok')
def testImportSameModuleDifferentNamespace(self):
"""
......@@ -436,7 +434,7 @@ context.Base_renderAsHtml(image)
# First we execute a jupyter_code which imports sys module as 'ss' namespace
jupyter_code = "import sys as ss"
reference = 'Test.Notebook.MutlipleImports %s' %time.time()
reference = 'Test.Notebook.MutlipleImports %s' % time.time()
portal.Base_executeJupyter(
reference=reference,
python_expression=jupyter_code
......
......@@ -60,11 +60,17 @@
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......@@ -100,4 +106,12 @@
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -60,11 +60,17 @@
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......@@ -100,4 +106,12 @@
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -13,11 +13,17 @@
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......@@ -49,4 +55,12 @@
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
# encoding: utf-8
dqe_resource_category = context.getPortalObject().portal_categories.http_exchange_resource.dqe
# Values are hard-coded to fr, it is for Data Warehouse use and Investigation tab
return {
......
# encoding: utf-8
resource_value = context.getResourceValue()
if not resource_value.isMemberOf('http_exchange_resource/dqe'):
return {}
......
......@@ -2,46 +2,64 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="DCWorkflowDefinition" module="Products.DCWorkflow.DCWorkflow"/>
<global name="Workflow" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<key> <string>_count</string> </key>
<value>
<tuple/>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>creation_guard</string> </key>
<key> <string>_mt_index</string> </key>
<value>
<none/>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<key> <string>categories</string> </key>
<value>
<tuple/>
<tuple>
<string>source/portal_workflow/dqe_transaction_workflow/state_draft</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<key> <string>default_reference</string> </key>
<value> <string>dqe_transaction_workflow</string> </value>
</item>
<item>
<key> <string>initial_state</string> </key>
<value> <string>draft</string> </value>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>dqe_transaction_workflow</string> </value>
</item>
<item>
<key> <string>manager_bypass</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<key> <string>state_variable</string> </key>
<value> <string>simulation_state</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>DQE Transaction Workflow</string> </value>
</item>
<item>
<key> <string>workflow_managed_permission</string> </key>
<value>
<tuple>
<string>Access contents information</string>
......@@ -51,15 +69,29 @@
</tuple>
</value>
</item>
<item>
<key> <string>state_var</string> </key>
<value> <string>simulation_state</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>DQE Transaction Workflow</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Scripts" module="Products.DCWorkflow.Scripts"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>scripts</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,40 +2,48 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancelled</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancelled</string> </value>
<key> <string>id</string> </key>
<value> <string>state_cancelled</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<tuple/>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancelled</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,44 +2,52 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>confirmed</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/dqe_transaction_workflow/transition_cancel</string>
<string>destination/portal_workflow/dqe_transaction_workflow/transition_deliver</string>
<string>destination/portal_workflow/dqe_transaction_workflow/transition_start</string>
</tuple>
</value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirmed</string> </value>
<key> <string>id</string> </key>
<value> <string>state_confirmed</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>deliver</string>
<string>start</string>
</tuple>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Confirmed</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,40 +2,48 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>delivered</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Delivered</string> </value>
<key> <string>id</string> </key>
<value> <string>state_delivered</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<tuple/>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Delivered</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,42 +2,50 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>draft</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/dqe_transaction_workflow/transition_confirm</string>
</tuple>
</value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Draft</string> </value>
<key> <string>id</string> </key>
<value> <string>state_draft</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<tuple>
<string>confirm</string>
</tuple>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Draft</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,42 +2,50 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>started</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/dqe_transaction_workflow/transition_deliver</string>
</tuple>
</value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<key> <string>description</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Started</string> </value>
<key> <string>id</string> </key>
<value> <string>state_started</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<tuple>
<string>deliver</string>
</tuple>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Started</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,59 +2,70 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow Interaction" module="erp5.portal_type"/>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<key> <string>action</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/movement_resource_interaction_workflow/script_Movement_copyUseFromResource</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_setUse</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>destination/portal_workflow/dqe_transaction_workflow/state_cancelled</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow Interaction</string> </value>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>0</int> </value>
<key> <string>guard_role</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<key> <string>icon</string> </key>
<value>
<tuple>
<string>_setResource.*</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>1</int> </value>
<key> <string>id</string> </key>
<value> <string>transition_cancel</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancel</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
......@@ -2,51 +2,66 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>destination/portal_workflow/dqe_transaction_workflow/state_confirmed</string>
</tuple>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard</string> </key>
<key> <string>guard_permission</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>confirm</string> </value>
<key> <string>guard_role</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>confirmed</string> </value>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<key> <string>id</string> </key>
<value> <string>transition_confirm</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -59,21 +74,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,51 +2,66 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>destination/portal_workflow/dqe_transaction_workflow/state_delivered</string>
</tuple>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>guard</string> </key>
<key> <string>guard_permission</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>deliver</string> </value>
<key> <string>guard_role</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>delivered</string> </value>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<key> <string>id</string> </key>
<value> <string>transition_deliver</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -59,21 +74,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,59 +2,70 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interaction Workflow Interaction" module="erp5.portal_type"/>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<key> <string>action</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/movement_resource_interaction_workflow/script_Movement_copyQuantityUnitFromResource</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_setQuantityUnit</string> </value>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>destination/portal_workflow/dqe_transaction_workflow/state_started</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interaction Workflow Interaction</string> </value>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<key> <string>guard_group</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type_group_filter</string> </key>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>0</int> </value>
<key> <string>guard_role</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<key> <string>icon</string> </key>
<value>
<tuple>
<string>_setResource.*</string>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>trigger_once_per_transaction</string> </key>
<value> <int>1</int> </value>
<key> <string>id</string> </key>
<value> <string>transition_start</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Start</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Transitions" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transitions</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></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>cancel</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></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>start</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>started</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Start</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Transition id</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_action</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,19 +2,13 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -25,34 +19,21 @@
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
<key> <string>id</string> </key>
<value> <string>variable_actor</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actor</string> </value>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<key> <string>variable_default_expression</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -2,19 +2,13 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -25,34 +19,21 @@
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>1</int> </value>
<key> <string>id</string> </key>
<value> <string>variable_comment</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>comment</string> </value>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<key> <string>variable_default_expression</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Error message if validation failed</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_error_message</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,19 +2,13 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_expr</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_value</string> </key>
<value> <string></string> </value>
<key> <string>automatic_update</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -25,34 +19,21 @@
<value> <int>0</int> </value>
</item>
<item>
<key> <string>for_status</string> </key>
<value> <int>0</int> </value>
<key> <string>id</string> </key>
<value> <string>variable_history</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>history</string> </value>
<key> <string>status_included</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>info_guard</string> </key>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>update_always</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<key> <string>variable_default_expression</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Portal type (used as filter for worklists)</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_portal_type</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Transition timestamp</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_time</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Worklists" module="Products.DCWorkflow.Worklists"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_mapping</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>worklists</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_system_event
\ No newline at end of file
erp5_system_event
erp5_web_service
erp5_credential
\ No newline at end of file
......@@ -74,4 +74,7 @@ class_definition = {
}
}
return json.dumps(dict(graph=getBusinessProcessGraph(context), class_definition=class_definition), indent=2)
return json.dumps(
dict(graph=getBusinessProcessGraph(context), class_definition=class_definition),
sort_keys=True,
indent=2)
......@@ -89,4 +89,7 @@ class_definition = {
}
}
return json.dumps(dict(graph=getDCWorkflowGraph(context), class_definition=class_definition), indent=2)
return json.dumps(
dict(graph=getDCWorkflowGraph(context), class_definition=class_definition),
sort_keys=True,
indent=2)
......@@ -64,4 +64,7 @@ def getWorkflowGraph(workflow):
graph['node'][state_id]['coordinate'] = position_graph['node'][state_id]['coordinate']
return graph
return json.dumps(dict(graph=getWorkflowGraph(context), class_definition={}), indent=2)
return json.dumps(
dict(graph=getWorkflowGraph(context), class_definition={}),
sort_keys=True,
indent=2)
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>height</string> </key>
<value> <int>284</int> </value>
<value> <int>277</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
......
......@@ -677,7 +677,8 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
json.dumps(ensureSerializable({
'original_form_id': form.id,
'field_id': field.id
})))))
}),
sort_keys=True))))
}
})
......@@ -799,9 +800,9 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
"form_relative_url": "%s/%s" % (form_relative_url, field.id),
"list_method": list_method_name,
"default_param_json": bytes2str(urlsafe_b64encode(str2bytes(
json.dumps(ensureSerializable(list_method_query_dict))))),
json.dumps(ensureSerializable(list_method_query_dict), sort_keys=True)))),
"extra_param_json": bytes2str(urlsafe_b64encode(str2bytes(
json.dumps(ensureSerializable(extra_param_dict)))))
json.dumps(ensureSerializable(extra_param_dict), sort_keys=True))))
}
# once we imprint `default_params` into query string of 'list method' we
# don't want them to propagate to the query as well
......@@ -820,7 +821,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None,
"script_id": script.id,
"relative_url": traversed_document.getRelativeUrl().replace("/", "%2F"),
"list_method": list_method_name,
"default_param_json": bytes2str(urlsafe_b64encode(str2bytes(json.dumps(ensureSerializable(list_method_query_dict)))))
"default_param_json": bytes2str(urlsafe_b64encode(str2bytes(json.dumps(ensureSerializable(list_method_query_dict), sort_keys=True))))
}
list_method_query_dict = {}
"""
......@@ -1069,7 +1070,9 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
'proxy_listbox_id': x,
'original_form_id': extra_param_json['original_form_id'],
'field_id': extra_param_json['field_id']
})))))
}),
sort_keys=True,
))))
}) for x, y in proxy_form_id_list],
"first_item": 1,
"required": 0,
......@@ -1092,7 +1095,8 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
'proxy_listbox_id': REQUEST.get('proxy_listbox_id', None),
'original_form_id': extra_param_json['original_form_id'],
'field_id': extra_param_json['field_id']
})))))
}),
sort_keys=True))))
}
# Go through all groups ("left", "bottom", "hidden" etc.) and add fields from
......@@ -1591,7 +1595,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
"script_id": script.id, # this script (ERP5Document_getHateoas)
"relative_url": getRealRelativeUrl(traversed_document).replace("/", "%2F"),
"view": erp5_action_list[-1]['name'],
"extra_param_json": bytes2str(urlsafe_b64encode(str2bytes(json.dumps(ensureSerializable(extra_param_json)))))
"extra_param_json": bytes2str(urlsafe_b64encode(str2bytes(json.dumps(ensureSerializable(extra_param_json), sort_keys=True))))
}
if erp5_action_list:
......@@ -1758,7 +1762,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
'relative_url': relative_url,
'group_by': group_by,
'sort_on': sort_on
})))))
}),
sort_keys=True,
))))
# set 'here' for field rendering which contain TALES expressions
REQUEST.set('here', traversed_document)
......@@ -2205,7 +2211,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
"relative_url": url_parameter_dict['view_kw']['jio_key'].replace("/", "%2F"),
"view": url_parameter_dict['view_kw']['view'],
"extra_param_json": bytes2str(urlsafe_b64encode(str2bytes(
json.dumps(ensureSerializable(extra_url_param_dict)))))
json.dumps(ensureSerializable(extra_url_param_dict), sort_keys=True))))
}
# endfor select
......@@ -2353,7 +2359,8 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
checkPermission = portal.Base_checkPermission
work_list = []
for action in action_list:
query = sql_catalog.buildQuery(action['query'])\
# sort the query for easier testing
query = sql_catalog.buildQuery(OrderedDict(sorted(action['query'].items())))\
.asSearchTextExpression(sql_catalog)
if (action['local_roles']):
......@@ -2423,7 +2430,7 @@ if mode == 'url_generator':
else:
generator_key = 'traverse_generator_action'
keep_items_json = bytes2str(urlsafe_b64encode(str2bytes(
json.dumps(ensureSerializable(keep_items)))))
json.dumps(ensureSerializable(keep_items), sort_keys=True))))
return url_template_dict[generator_key] % {
"root_url": site_root.absolute_url(),
"script_id": 'ERP5Document_getHateoas',
......
......@@ -30,8 +30,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,4 +37,7 @@ for i, tracking in enumerate(reversed(portal.portal_simulation.getTrackingList(a
link=movement.absolute_url(),
source=movement.getSourceUid() or "null",
destination=movement.getDestinationUid() or "null")
return json.dumps(dict(graph=graph, class_definition=class_definition), indent=2)
return json.dumps(
dict(graph=graph, class_definition=class_definition),
sort_keys=True,
indent=2)
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>6.0</float> </value>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -24,8 +24,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -25,6 +25,7 @@
#
##############################################################################
import six.moves.urllib.parse
import uuid
import mock
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
......@@ -92,11 +93,15 @@ class TestFacebookLogin(ERP5TypeTestCase):
self.logout()
self.portal.ERP5Site_redirectToFacebookLoginPage()
location = self.portal.REQUEST.RESPONSE.getHeader("Location")
self.assertIn("https://www.facebook.com/v2.10/dialog/oauth?", location)
self.assertIn("scope=email&redirect_uri=", location)
self.assertIn("client_id=%s" % CLIENT_ID, location)
self.assertNotIn("secret_key=", location)
self.assertIn("ERP5Site_callbackFacebookLogin", location)
parsed_location = six.moves.urllib.parse.urlparse(location)
self.assertEqual(parsed_location.hostname, 'www.facebook.com')
self.assertEqual(parsed_location.path, '/v2.10/dialog/oauth')
params = dict(six.moves.urllib.parse.parse_qsl(parsed_location.query))
self.assertEqual(params['scope'], 'email')
self.assertEqual(params['client_id'], CLIENT_ID)
self.assertIn("redirect_uri", params)
self.assertNotIn("secret_key", params)
def test_existing_user(self):
self.login()
......
......@@ -116,7 +116,7 @@ social_contribution_stop_date = None
for employee_result in paysheet_data_list:
employee_ctp = employee_result['ctp']
for ctp_code in employee_ctp:
if social_contribution_organisation is None:
if social_contribution_organisation is None and 'corporate_registration_code' in employee_ctp[ctp_code]:
social_contribution_organisation = employee_ctp[ctp_code]['corporate_registration_code']
social_contribution_start_date = employee_ctp[ctp_code]['start_date']
social_contribution_stop_date = employee_ctp[ctp_code]['stop_date']
......@@ -284,13 +284,13 @@ for employee_data_dict, paysheet_data_dict in employee_result_list:
for remuneration_block in paysheet_data_dict['remuneration']:
dsn_file.append(remuneration_block)
for bonus_category in sorted(six.itervalues(paysheet_data_dict['other_bonus'])):
for bonus_category in sorted(six.itervalues(paysheet_data_dict['other_bonus']), key=lambda v: (v['code'],)):
dsn_file.append(getDSNBlockDict(block_id='S21.G00.52', target=bonus_category))
for bonus_category in sorted(six.itervalues(paysheet_data_dict['other_income'])):
for bonus_category in sorted(six.itervalues(paysheet_data_dict['other_income']), key=lambda v: (v['code'],)):
dsn_file.append(getDSNBlockDict(block_id='S21.G00.54', target=bonus_category))
for taxable_base_category in sorted(six.itervalues(paysheet_data_dict['taxable_base'])):
for taxable_base_category in sorted(six.itervalues(paysheet_data_dict['taxable_base']), key=lambda v: (v['code'], v['contract_id'],)):
dsn_file.append(getDSNBlockDict(block_id='S21.G00.78', target=taxable_base_category))
if taxable_base_category['code'] == '02': # Assiette Brute plafonnee
if ('063', '') in paysheet_data_dict['individual_contribution']:
......
......@@ -205,19 +205,6 @@ S21.G00.54.001,'18'
S21.G00.54.002,'23.00'
S21.G00.54.003,'01012015'
S21.G00.54.004,'31012015'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'94.91'
S21.G00.78.001,'02'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
......@@ -236,10 +223,27 @@ S21.G00.81.001,'226'
S21.G00.81.002,'75367340900011'
S21.G00.81.003,'2250.00'
S21.G00.81.005,'59378'
S21.G00.78.001,'04'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'2305.53'
S21.G00.78.001,'07'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'2250.00'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'94.91'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
......@@ -249,10 +253,6 @@ S21.G00.79.001,'11'
S21.G00.79.004,'2250.00'
S21.G00.81.001,'059'
S21.G00.81.004,'15.75'
S21.G00.78.001,'04'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'2305.53'
S21.G00.81.001,'018'
S21.G00.81.002,'75367340900011'
S21.G00.81.003,'2250.00'
......@@ -335,19 +335,6 @@ S21.G00.54.001,'17'
S21.G00.54.002,'62.40'
S21.G00.54.003,'01012015'
S21.G00.54.004,'31012015'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'94.07'
S21.G00.78.001,'02'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
......@@ -364,10 +351,27 @@ S21.G00.81.001,'226'
S21.G00.81.002,'75367340900011'
S21.G00.81.003,'3085.28'
S21.G00.81.005,'59378'
S21.G00.78.001,'04'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'4125.36'
S21.G00.78.001,'07'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'3085.28'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'94.07'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
......@@ -377,10 +381,6 @@ S21.G00.79.001,'11'
S21.G00.79.004,'3085.28'
S21.G00.81.001,'059'
S21.G00.81.004,'21.60'
S21.G00.78.001,'04'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'4125.36'
S21.G00.86.001,'01'
S21.G00.86.002,'02'
S21.G00.86.003,'11'
......@@ -459,36 +459,12 @@ S21.G00.54.001,'17'
S21.G00.54.002,'67.20'
S21.G00.54.003,'01012015'
S21.G00.54.004,'31012015'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'86.36'
S21.G00.78.001,'02'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'3170.00'
S21.G00.81.001,'063'
S21.G00.81.004,'323.55'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'2'
S21.G00.79.001,'11'
S21.G00.79.004,'3170.00'
S21.G00.79.001,'13'
S21.G00.79.004,'657.86'
S21.G00.81.001,'059'
S21.G00.81.004,'29.29'
S21.G00.78.001,'03'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
......@@ -499,14 +475,38 @@ S21.G00.81.001,'226'
S21.G00.81.002,'75367340900011'
S21.G00.81.003,'3827.86'
S21.G00.81.005,'59378'
S21.G00.78.001,'04'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'3847.23'
S21.G00.78.001,'07'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'3827.86'
S21.G00.78.001,'04'
S21.G00.78.001,'13'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'3847.23'
S21.G00.78.004,'86.36'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'1'
S21.G00.79.001,'20'
S21.G00.79.004,'97.16'
S21.G00.81.001,'059'
S21.G00.81.004,'97.16'
S21.G00.78.001,'31'
S21.G00.78.002,'01012015'
S21.G00.78.003,'31012015'
S21.G00.78.004,'0.00'
S21.G00.78.005,'2'
S21.G00.79.001,'11'
S21.G00.79.004,'3170.00'
S21.G00.79.001,'13'
S21.G00.79.004,'657.86'
S21.G00.81.001,'059'
S21.G00.81.004,'29.29'
S21.G00.86.001,'01'
S21.G00.86.002,'02'
S21.G00.86.003,'11'
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
......@@ -37,8 +37,8 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>start_date</string>
<string>stop_date</string>
<string>start_date</string>
</tuple>
</value>
</item>
......
erp5_full_text_mroonga_catalog
erp5_base
\ No newline at end of file
erp5_base
erp5_worklist_sql
erp5_security_uid_innodb_catalog_test
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL Method" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z0_drop_alternate_roles_and_users</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>SQL Method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>z0_drop_alternate_roles_and_users</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
DELETE FROM alternate_roles_and_users
WHERE <dtml-sqltest uid op=eq type=int multiple>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL Method" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>uid</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z0_uncatalog_alternate_roles_and_users</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>SQL Method</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>z0_uncatalog_alternate_roles_and_users</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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