create branch 3.0

--HG--
branch : 3.0
Get cp_warehouse_id only when it must be available in the context.

issue3688
review3641002
(grafted from c7824dc9927e58dc2c93c67a734d177ed26fed83)

--HG--
branch : 3.0
extra : source : c7824dc9927e58dc2c93c67a734d177ed26fed83