fix scrollup on click action in TCO

This commit is contained in:
bachir souldi
2022-07-21 14:08:10 +01:00
parent cabe76bfba
commit ae214d14ac
2 changed files with 23 additions and 1 deletions

View File

@@ -75,6 +75,16 @@ public class PurchaseOrderSupplierLineService {
poSupplierLineRepo.save(purchaseOrderSupplierLine); poSupplierLineRepo.save(purchaseOrderSupplierLine);
} }
@Transactional(rollbackOn = {Exception.class})
public void refuse(PurchaseOrderSupplierLine purchaseOrderSupplierLine) throws AxelorException {
purchaseOrderSupplierLine.setStateSelect(PurchaseOrderSupplierLineRepository.STATE_NOT_ACCEPTED);
// sophal add acceptedOn and By TCO
purchaseOrderSupplierLine.setRefusalDate(appPurchaseService.getTodayDate());
purchaseOrderSupplierLine.setRefusedByUser(AuthUtils.getUser());;
poSupplierLineRepo.save(purchaseOrderSupplierLine);
}
public PurchaseOrderSupplierLine create(Partner supplierPartner, BigDecimal price) { public PurchaseOrderSupplierLine create(Partner supplierPartner, BigDecimal price) {
return new PurchaseOrderSupplierLine( return new PurchaseOrderSupplierLine(

View File

@@ -78,7 +78,19 @@ public class PurchaseOrderSupplierLineController {
// sophal refresh purchase order price // sophal refresh purchase order price
Beans.get(PurchaseOrderService.class).computePurchaseOrder(order); Beans.get(PurchaseOrderService.class).computePurchaseOrder(order);
Beans.get(PurchaseOrderService.class).updateCostPrice(order); Beans.get(PurchaseOrderService.class).updateCostPrice(order);
response.setReload(true); // response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
public void refuse(ActionRequest request, ActionResponse response) {
PurchaseOrderSupplierLine purchaseOrderSupplierLine =
Beans.get(PurchaseOrderSupplierLineRepository.class)
.find(request.getContext().asType(PurchaseOrderSupplierLine.class).getId());
try {
Beans.get(PurchaseOrderSupplierLineService.class).refuse(purchaseOrderSupplierLine);
} catch (Exception e) { } catch (Exception e) {
TraceBackService.trace(response, e); TraceBackService.trace(response, e);
} }