(xform)
return StockFormActions(stock_report_helpers, case_action_intents)
Pulls out the ledger blocks and case action intents from a form and returns them
    in a StockFormActions object.

    The stock_report_helpers are StockReportHelper objects, which are basically parsed commtrack actions.
    They should only affect ledger data.

    The case_action_intents are the actions that should be applied to the case, and should not contain
    any ledger data. These are just marker actions that can be used in looking up a case's forms or
    in rebuilding it.
Pulls out the ledger blocks and case action intents from a form and returns them
    in a StockFormActions object.
Pulls out the ledger blocks and case action intents from a form and returns them in a StockFormActions object .
def get_stock_actions(xform):
    """
    Pulls out the ledger blocks and case action intents from a form and returns them
    in a StockFormActions object.

    The stock_report_helpers are StockReportHelper objects, which are basically parsed commtrack actions.
    They should only affect ledger data.

    The case_action_intents are the actions that should be applied to the case, and should not contain
    any ledger data. These are just marker actions that can be used in looking up a case's forms or
    in rebuilding it.
    """
    if is_device_report(xform):
        return _empty_actions()

    stock_report_helpers = list(get_all_stock_report_helpers_from_form(xform))
    transaction_helpers = [
        transaction_helper
        for stock_report_helper in stock_report_helpers
        for transaction_helper in stock_report_helper.transactions
    ]
    if not transaction_helpers:
        return _empty_actions()

    case_ids = {transaction_helper.case_id for transaction_helper in transaction_helpers}
    case_action_intents = get_ledger_case_action_intents(xform, case_ids)
    return StockFormActions(stock_report_helpers, case_action_intents)
def get_stock_actions ( xform ) : if is_device_report ( xform ) : return _empty_actions ( ) stock_report_helpers = list ( get_all_stock_report_helpers_from_form ( xform ) ) transaction_helpers = [ transaction_helper for stock_report_helper in stock_report_helpers for transaction_helper in stock_report_helper . transactions ] if not transaction_helpers : return _empty_actions ( ) case_ids = { transaction_helper . case_id for transaction_helper in transaction_helpers } case_action_intents = get_ledger_case_action_intents ( xform , case_ids ) return StockFormActions ( stock_report_helpers , case_action_intents )