NOTE: replying on the dev list since this involves development of
OFBiz itself.
While we could have it look at a different role I agree that instead
populating the SHIP_FROM_VENDOR is a better approach, with some issues
though.
Part of the reason I think it's a better approach is that it is more
flexible as this information can come from various places. On the
other hand, that also makes it more difficult to implement because it
can come from multiple places.
How this happened is a good question. If anyone wants to do some SVN
forensics and see if this was ever populated, or the code used to look
for a different role, or whatever the cause of this problem was it
would be interesting.
Anyway, moving forward... the easiest way to populate this would be to
set it to the same value as the BILL_FROM_VENDOR, but really they can
be different and that's the point of having the different roles.
To make this more interesting there can be different SHIP_FROM_VENDOR
parties for different OrderItemShipGroup records in an order. In other
words, we can't look at the OrderRole or OrderItemRole values for
this, it has to be per ship group.
Based on that here is what I think we should change it to do:
1. first look at the OrderItemShipGroup.vendorPartyId and use that if
it is populated
2. if that is not populated look up the ship-from Facility using the
OrderItemShipGroup.facilityId, and then look at the facility owner
using the Facility.ownerPartyId field
3. if neither of those is populated look for an OrderRole for
SHIP_FROM_VENDOR
4. if that is also not found then default to the OrderRole for
BILL_FROM_VENDOR
Does that sounds reasonable? Does anyone else have any thoughts on how
this can/should work?
-David
On Jun 4, 2009, at 9:37 AM, Pranay Pandey wrote:
Hello All,
Here I am giving details of the issue:
1. What I did:
a. Created a Sales order.
b. Completed Packing process.
c. Got a shipment created.
d. Viewed Shipment details.
2. What did I expect:
Wanted to check "to" and "from" parties there.
3. What did I get:
Got "to" party but didn't see "from" party there.
I looked in to the process and code and can see that there is no
OrderRole is being set for Company to "SHIP_FROM_VENDOR" for sales
orders. We are not setting it in the cart to go there for further
processing.
So at the time when createShipment service called it doesn't find
this role for shipment.partyIdFrom in ShipmentServices.xml lines 437
to 447 and leaves it without partyId and we don't have it in created
shipment.
So now the main concern is that should we set a OrderRole for
Company to SHIP_FROM_VENDOR for a sales order which is not done at
this moment.
Thanks & Regards
--
Pranay Pandey