You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/10/09 06:28:00 UTC

[jira] [Commented] (OFBIZ-13660) Fix regressions in QuoteServicesScript.groovy introduced by the mini-lang conversion

    [ https://issues.apache.org/jira/browse/OFBIZ-13660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125361#comment-18125361 ] 

ASF subversion and git services commented on OFBIZ-13660:
---------------------------------------------------------

Commit 528199b34c520f1f431dd7fc024ac4386feb9e77 in ofbiz-framework's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=528199b34c ]

Fixed: Regressions in QuoteServicesScript.groovy introduced by the mini-lang conversion (OFBIZ-13660)

The Groovy conversion of QuoteServices.xml changed the behaviour of several services. Restore the mini-lang behaviour:

- copyQuote: copy each quote item with the copyQuoteItem service so that the item level adjustments are copied too
- createQuoteAndQuoteItemForRequest: build the quote from the request fields the mini-lang used instead of spreading the whole CustRequest, which leaked its CRQ_ status into the quote, let the submitted quote item fields take precedence over the request item, and skip a quote role that createQuote already created
- createQuoteItem and autoUpdateQuotePrice: treat a price of zero as a value instead of as missing


> Fix regressions in QuoteServicesScript.groovy introduced by the mini-lang conversion
> ------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13660
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13660
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Upcoming Branch, 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>
> Third-pass re-audit of {{QuoteServicesScript.groovy}} against the original {{QuoteServices.xml}} (conversion {{98814e5c03}}). The fixes from the earlier passes are complete and every permission guard matches; the following were not covered.
> *1. {{copyQuote}} drops item-level adjustments.* The mini-lang called the {{copyQuoteItem}} service, which also copied each item's {{QuoteAdjustment}} rows; the Groovy calls {{createQuoteItem}} directly and its adjustment loop skips every adjustment that has a {{quoteItemSeqId}}. A copy with items and adjustments checked produces a quote with wrong totals.
> *2. {{createQuoteAndQuoteItemForRequest}} leaks the request status into the quote.* The input map spreads {{*: custRequest}}, so {{input.statusId}} is the CustRequest's {{CRQ_*}} status and the {{?: 'QUO_CREATED'}} default never applies. The quote is created in a {{CRQ_*}} status that has no valid transition to a {{QUO_*}} status.
> *3. The same method ignores the QuoteItem fields the form submits.* The item is created from {{*: custRequestItem}} only, so a unit price, feature, uom, quantity etc. entered on CreateQuoteAndQuoteItemForRequest are lost (the mini-lang copied the non-PK fields from the parameters). It also dereferences {{custRequestItem.story}} without a null check.
> *4. A price of 0 is treated as empty.* {{createQuoteItem}} uses {{if (!parameters.quoteUnitPrice && ...)}} and {{autoUpdateQuotePrice}} uses {{if (parameters.manualQuoteUnitPrice)}} / {{else if (parameters.defaultQuoteUnitPrice)}}; the mini-lang used {{if-empty}} / {{if-not-empty}}. An explicit 0 is repriced or ignored.
> *5. Duplicate {{REQ_TAKER}} role (conditional).* Because the method now goes through {{createQuote}}, which adds a REQ_TAKER role for the logged-in party, copying the CustRequestParty roles can hit a duplicate key when the request already has that party as REQ_TAKER. {{copyQuote}} and {{createQuoteFromCustRequest}} already skip or de-duplicate this role.
> h3. Fix
> Call {{copyQuoteItem}} (or copy item adjustments) in {{copyQuote}}; build the {{createQuote}} input from an explicit field list; pass the submitted QuoteItem fields through; use null checks for the price tests; skip an already existing REQ_TAKER role.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)