svn commit: r1741960 - /ofbiz/trunk/applications/accounting/widget/AgreementForms.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1741960 - /ofbiz/trunk/applications/accounting/widget/AgreementForms.xml

jleroux@apache.org
Author: jleroux
Date: Mon May  2 11:02:36 2016
New Revision: 1741960

URL: http://svn.apache.org/viewvc?rev=1741960&view=rev
Log:
A patch from Ingo Wolfmayr for "Agreement Search List requires partyIdFrom/partyIdTo or fails" - https://issues.apache.org/jira/browse/OFBIZ-7030

How tot test!
Create a new agreement and fill the following fields:

    partyTo (for ex. DemoCustomer)
    Role Type Id From (for ex. Client)
    Role Type Id To(for ex. Bill-to customer)
    Agreement Type ID (for ex. Sales)
    Description: test

error: Error in form [ListAgreements] calling service with name [getPartyNameForDate]: org.ofbiz.service.ServiceValidationException: The following required parameter is missing: [getPartyNameForDate.partyId]java.lang.IllegalArgumentException: Error in form [ListAgreements] calling service with name [getPartyNameForDate]: org.ofbiz.service.ServiceValidationException: The following required parameter is missing: [getPartyNameForDate.partyId]

I create a generic agreement (from company to all customers with no specific agreements) - I could not access it after creation.

This more a workaround than a fix but it works and is better than an error message. Missing fields will be set to empty field. Service will be called and return nothing.

Modified:
    ofbiz/trunk/applications/accounting/widget/AgreementForms.xml

Modified: ofbiz/trunk/applications/accounting/widget/AgreementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementForms.xml?rev=1741960&r1=1741959&r2=1741960&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AgreementForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AgreementForms.xml Mon May  2 11:02:36 2016
@@ -60,15 +60,20 @@ under the License.
                 <field-map field-name="viewIndex" from-field="viewIndex"/>
                 <field-map field-name="viewSize" from-field="viewSize"/>
             </service>
+            
+            <!--Fallback if partyIdFrom or partyIdTo is empty, at this time it is not possible to add is-empty condition in widgets (in this case to prevent service call)-->
+            <set field="partyIdFromTmp" from-field="parameters.partyIdFrom" default-value=""/>
+            <set field="partyIdToTmp" from-field="parameters.partyIdTo" default-value=""/>
+            
         </actions>
         <row-actions>
             <service service-name="getPartyNameForDate" result-map="partyNameResultFrom">
-                <field-map field-name="partyId" from-field="partyIdFrom"/>
+                <field-map field-name="partyId" from-field="partyIdFromTmp"/>
                 <field-map field-name="compareDate" from-field="agreementDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>
             <service service-name="getPartyNameForDate" result-map="partyNameResultTo">
-                <field-map field-name="partyId" from-field="partyIdTo"/>
+                <field-map field-name="partyId" from-field="partyIdToTmp"/>
                 <field-map field-name="compareDate" from-field="agreementDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>