/**
 * Axelor Business Solutions
 *
 * Copyright (C) 2015 Axelor (<http://axelor.com>).
 *
 * This program is free software: you can redistribute it and/or  modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.axelor.apps.base.web;

import com.axelor.apps.base.db.PriceList;
import com.axelor.apps.base.service.PriceListService;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.google.inject.Inject;

public class PriceListController {
	
	@Inject 
	private PriceListService priceListService;
	
	public void historizePriceList(ActionRequest request, ActionResponse response){
		PriceList priceList = request.getContext().asType(PriceList.class);
		priceList = priceListService.historizePriceList(priceList);
		response.setReload(true);
	}
}

@@ -766,24 +766,81 @@
 .PriceList;%0A
+import com.axelor.apps.base.db.repo.PriceListRepository;%0A
 import com.a
@@ -881,16 +881,16 @@
 ervice;%0A
-
 import c
@@ -1083,16 +1083,73 @@
 vice;%0A%09%0A
+%09@Inject%0A%09protected PriceListRepository priceListRepo;%0A%09%0A
 %09public 
@@ -1221,16 +1221,16 @@
 ponse)%7B%0A
-
 %09%09PriceL
@@ -1291,16 +1291,69 @@
 class);%0A
+%09%09priceList = priceListRepo.find(priceList.getId());%0A
 %09%09priceL

Fix NPE on priceLists