http://ofbiz.116.s1.nabble.com/Users-product-requirements-tp138923p138933.html
the selected supplier so I used a modified version of that.
> Fred,
>
> why not simply patching the existing minilang service:
>
> Index:
> applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
> ===================================================================
> ---
> applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
> (revision 7548)
> +++
> applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml
> (working copy)
> @@ -74,10 +74,11 @@
>
> <simple-method method-name="getRequirementsForSupplier"
> short-description="Get the requirements applicable to a given supplier">
> <make-value value-name="newEntity" entity-name="Requirement"/>
> - <entity-condition entity-name="Requirement"
> list-name="requirementsForSupplier">
> + <entity-condition entity-name="RequirementAndProductSupplier"
> list-name="requirementsForSupplier">
> <condition-list>
> <condition-object
> field-name="parameters.requirementConditions"/>
> <condition-expr field-name="statusId"
> value="REQ_APPROVED"/>
> + <condition-expr field-name="partyId"
> env-name="parameters.partyId"/>
> <condition-list combine="or">
> <condition-expr field-name="requirementTypeId"
> value="MRP_PRO_PURCH_ORDER"/>
> <condition-expr field-name="requirementTypeId"
> value="PRODUCT_REQUIREMENT"/>
>
>
> ?
>
> You'll have to define the RequirementAndProductSupplier view-entity to
> make the abve code work correctly.
>
> Jacopo
>
> Fred Forester wrote:
>
>>Jacopo,
>>
>>it makes sense that the productId is part of the incoming
>>requirementConditions. however, how do I merge or combine the
>>requirementConditions with the mainCond?
>>
>>thanx
>>Fred
>>
>>
>>
>>
>>Jacopo Cappellato wrote:
>>
>>>Fred,
>>>
>>>thanks for your work.
>>>
>>>I think you should add the incoming requirementConditions as they are to
>>>the other conditions of your service.
>>>
>>>You should also remove the productId parameter (that is not even
>>>declared in the service definition); if the user has selected a
>>>productId to filter out requirements, this condition will be in the
>>>requirementConditions.
>>>
>>>Does it make sense?
>>>
>>>Jacopo
>>>
>>>Fred Forester wrote:
>>>
>>>
>>>>Jacopo,
>>>>
>>>>the patch is attached and based on 7445
>>>>
>>>>I wasnt sure how to merge the incomming requirementConditions with the
>>>>conditions being built by the code. comments welcome.
>>>>
>>>>Thanx
>>>>Fred
>>>>
>>>>
>>>
>>>
>>>_______________________________________________
>>>Users mailing list
>>>
[hidden email]
>>>
http://lists.ofbiz.org/mailman/listinfo/users>>>
>>>
>>
>>
>>_______________________________________________
>>Users mailing list
>>
[hidden email]
>>
http://lists.ofbiz.org/mailman/listinfo/users>>
>
>
>
> _______________________________________________
> Users mailing list
>
[hidden email]
>
http://lists.ofbiz.org/mailman/listinfo/users>
>