Commit 458ae10c authored by Jérome Perrin's avatar Jérome Perrin

trade: allow setting function and funding by trade model path

parent 00c4a1f3
......@@ -81,6 +81,8 @@
<string>my_source_project_title</string>
<string>my_source_reference</string>
<string>my_source_carrier_title</string>
<string>my_source_function_title</string>
<string>my_source_funding_title</string>
</list>
</value>
</item>
......@@ -97,6 +99,8 @@
<string>my_destination_project_title</string>
<string>my_destination_reference</string>
<string>my_destination_carrier_title</string>
<string>my_destination_function_title</string>
<string>my_destination_funding_title</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>portal_type</string>
<string>proxy_listbox_ids</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_function_title</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>description</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>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</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>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_destination_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Organisation</string>
<string>Organisation</string>
</tuple>
<tuple>
<string>Person</string>
<string>Person</string>
</tuple>
<tuple>
<string>Account</string>
<string>Account</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</string> </key>
<value>
<list>
<tuple>
<string>Base_viewRelatedObjectListBase/listbox</string>
<string>All</string>
</tuple>
<tuple>
<string>ActivityModule_viewAActivityList/listbox</string>
<string>Activities</string>
</tuple>
<tuple>
<string>ERP5Site_viewClientNodeList/listbox</string>
<string>Clients</string>
</tuple>
<tuple>
<string>ERP5Site_viewSupplierNodeList/listbox</string>
<string>Suppliers</string>
</tuple>
<tuple>
<string>OrganisationModule_viewOrganisationList/listbox</string>
<string>Organisations</string>
</tuple>
<tuple>
<string>PersonModule_viewPersonList/listbox</string>
<string>Persons</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Destination Function</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in context.getPortalNodeTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>portal_type</string>
<string>proxy_listbox_ids</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_funding_title</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>description</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>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</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>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_destination_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Organisation</string>
<string>Organisation</string>
</tuple>
<tuple>
<string>Person</string>
<string>Person</string>
</tuple>
<tuple>
<string>Account</string>
<string>Account</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</string> </key>
<value>
<list>
<tuple>
<string>Base_viewRelatedObjectListBase/listbox</string>
<string>All</string>
</tuple>
<tuple>
<string>ERP5Site_viewClientNodeList/listbox</string>
<string>Clients</string>
</tuple>
<tuple>
<string>ERP5Site_viewSupplierNodeList/listbox</string>
<string>Suppliers</string>
</tuple>
<tuple>
<string>OrganisationModule_viewOrganisationList/listbox</string>
<string>Organisations</string>
</tuple>
<tuple>
<string>PersonModule_viewPersonList/listbox</string>
<string>Persons</string>
</tuple>
<tuple>
<string>AccountModule_viewAccountList/listbox</string>
<string>Accounts</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Destination Funding</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in context.getPortalNodeTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>portal_type</string>
<string>proxy_listbox_ids</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_function_title</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>description</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>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</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>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_source_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Organisation</string>
<string>Organisation</string>
</tuple>
<tuple>
<string>Person</string>
<string>Person</string>
</tuple>
<tuple>
<string>Account</string>
<string>Account</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</string> </key>
<value>
<list>
<tuple>
<string>Base_viewRelatedObjectListBase/listbox</string>
<string>All</string>
</tuple>
<tuple>
<string>ActivityModule_viewAActivityList/listbox</string>
<string>Activities</string>
</tuple>
<tuple>
<string>ERP5Site_viewClientNodeList/listbox</string>
<string>Clients</string>
</tuple>
<tuple>
<string>ERP5Site_viewSupplierNodeList/listbox</string>
<string>Suppliers</string>
</tuple>
<tuple>
<string>OrganisationModule_viewOrganisationList/listbox</string>
<string>Organisations</string>
</tuple>
<tuple>
<string>PersonModule_viewPersonList/listbox</string>
<string>Persons</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Source Function</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in context.getPortalNodeTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>portal_type</string>
<string>proxy_listbox_ids</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_funding_title</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>description</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>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</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>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_source_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Organisation</string>
<string>Organisation</string>
</tuple>
<tuple>
<string>Person</string>
<string>Person</string>
</tuple>
<tuple>
<string>Account</string>
<string>Account</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</string> </key>
<value>
<list>
<tuple>
<string>Base_viewRelatedObjectListBase/listbox</string>
<string>All</string>
</tuple>
<tuple>
<string>ERP5Site_viewSupplierNodeList/listbox</string>
<string>Suppliers</string>
</tuple>
<tuple>
<string>ERP5Site_viewClientNodeList/listbox</string>
<string>Clients</string>
</tuple>
<tuple>
<string>OrganisationModule_viewOrganisationList/listbox</string>
<string>Organisations</string>
</tuple>
<tuple>
<string>PersonModule_viewPersonList/listbox</string>
<string>Persons</string>
</tuple>
<tuple>
<string>AccountModule_viewAccountList/listbox</string>
<string>Accounts</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Source Funding</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in context.getPortalNodeTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -385,13 +385,23 @@ class TestBPMImplementation(TestBPMDummyDeliveryMovementMixin):
portal_type='Organisation')
source_section_node = self.portal.organisation_module.newContent(
portal_type='Organisation')
source_function_node = self.portal.organisation_module.newContent(
portal_type='Organisation')
source_funding_node = self.portal.organisation_module.newContent(
portal_type='Organisation')
business_link = self.createBusinessLink()
business_link.setSourceValue(source_node)
business_link.setSourceSectionValue(source_section_node)
business_link.setSourceFunctionValue(source_function_node)
business_link.setSourceFundingValue(source_funding_node)
self.assertEqual([source_node], business_link.getSourceValueList())
self.assertEqual([source_node.getRelativeUrl()], business_link.getSourceList())
self.assertEqual(source_node.getRelativeUrl(),
business_link.getSource(default='something'))
self.assertEqual([source_section_node], business_link.getSourceSectionValueList())
self.assertEqual([source_function_node], business_link.getSourceFunctionValueList())
self.assertEqual([source_funding_node], business_link.getSourceFundingValueList())
def test_EmptyBusinessLinkStandardCategoryAccessProvider(self):
business_link = self.createBusinessLink()
......
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