Hi Jacques,

I think you can use context.payment to fix groovy.lang.MissingPropertyException
problem.
Here is the code sample, Its working on my local box without error:
{code}
          <set field="isDisbursement"
value="${groovy:if(context.payment!=void)return
org.ofbiz.accounting.util.UtilAccounting.isDisbursement(context.payment)}"/>
{code}


Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com

On Mon, May 2, 2016 at 11:42 PM, <jler...@apache.org> wrote:

> Author: jleroux
> Date: Mon May  2 18:12:08 2016
> New Revision: 1742018
>
> URL: http://svn.apache.org/viewvc?rev=1742018&view=rev
> Log:
> Fixes an issue found by chance. This was changed from bsh to groovy by
> r1613432 but does not work. I tried many variants but none works, all return
> groovy.lang.MissingPropertyException: No such property: payment for class:
> script....
> So back to origin :/
>
> Modified:
>     ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
>
> Modified: ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml?rev=1742018&r1=1742017&r2=1742018&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
> (original)
> +++ ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml Mon
> May  2 18:12:08 2016
> @@ -419,7 +419,7 @@ under the License.
>      <menu name="PaymentSubTabBar" extends="CommonTabBarMenu"
> extends-resource="component://common/widget/CommonMenus.xml"
>            menu-container-style="button-bar button-style-2">
>          <actions>
> -            <set field="isDisbursement"
> value="${groovy:if(payment!=void)return
> org.ofbiz.accounting.util.UtilAccounting.isDisbursement(payment)}"/>
> +            <set field="isDisbursement"
> value="${bsh:if(payment!=void)return
> org.ofbiz.accounting.util.UtilAccounting.isDisbursement(payment)}"/>
>          </actions>
>          <menu-item name="createNew" title="${uiLabelMap.CommonCreateNew}"
> widget-style="buttontext create" >
>              <condition>
>
>
>

Reply via email to