In this paper, we develop a two-warehouse imperfect production model under two cases: (i) model starts with shortages (ii) model ends with shortages. Most of the researchers proposed the models for perfect items but we develop for imperfect quality items, which is very realistic. Demand is taken as time dependent and dependent on the production. Holding cost in rented warehouse (RW) is greater than own warehouse (OW). Deterioration is taken as Weibull distribution in both OW and RW. Shortages are allowed and partially backlogged. The effect of learning on production cost is also considered. Learning from one cycle to other cycle, improve the efficiency of the organization. A numerical example including the sensitivity analysis is given to validate the results of the production-inventory model.