Avoid performing actions on non-relevant ACQ lineitems

Bug #1193095 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.4
Fix Released
Medium
Unassigned

Bug Description

There are a number of actions in the acquisitions top-level actions drop-down meant to apply to batches of lineitems. In many case, the interface is attempting to perform actions against lineitems in nonsensical ways. A simple example is an attempt to cancel an already-canceled lineitem. Of particular interest are the following actions:

create PO
add to PO
create invoice
add to invoice
cancel lineitem
mark selector ready
mark order ready
mark received

Code coming forthwith to apply some additional filters to selected lineitems before applying these actions.

Revision history for this message
Bill Erickson (berick) wrote :

Code pushed to:

working/user/berick/lp1193095-acq-batch-actions-filtering

This touches a lot of actions, so testing is much appreciated.

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.5.0-m2
Revision history for this message
Bill Erickson (berick) wrote :

For further reference, from the commit:

Avoid applying the following actions to lineitems which are in a state where each action makes no sense.

The following actions are affected. For each, the set of states for which a lineitem must be in for the action to proceed is listed.

    create PO
        - new selector-ready order-ready approved
    add to PO
        - new selector-ready order-ready approved
    create invoice
        - !cancelled
    add to invoice
        - !cancelled
    cancel lineitem
        - !cancelled
    mark selector ready
        - new
    mark order ready
        - new selector-ready
    mark received
        - pending-order on-order

Depending on the interface, some top-level lineitem actions may be globally disabled. The list of states listed above represent the bare minimum requirements.

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

I notice that under mark received the state pending-order is listed as one of the states where this function should work. I don't believe we want it to be possible to receive an item that is pending-order as that then makes it impossible to activate the purchase order.

Revision history for this message
Bill Erickson (berick) wrote :

Hi Jennifer, thanks, that makes sense. I was going to apply a patch for this, but realized as I was testing that we are already protecting against this scenario. The "Mark Selected Lineitems as Received" action in the selector is only active/usable after the PO has been activated (and the lineitems are "on-order"). So, while the code in my branch would not prevent a pending-order lineitem from being received, there is actually no way to do it in practice.

Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-m2 → 2.5.0-alpha1
Ben Shum (bshum)
Changed in evergreen:
status: New → Triaged
importance: Undecided → Medium
Remington Steed (rjs7)
Changed in evergreen:
milestone: 2.5.0-alpha1 → 2.5.0-alpha2
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-alpha2 → 2.5.0-beta1
Dan Wells (dbw2)
tags: added: 2.5-beta-blocker
Revision history for this message
Mike Rylander (mrylander) wrote :

Let the unblocking commence!

Changed in evergreen:
status: Triaged → Fix Committed
Dan Wells (dbw2)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.