Get cp_warehouse_id only when it must be available in the context.

issue3688
review3641002