Search in sources :

Example 1 with PartnerSupplychainLinkService

use of com.axelor.apps.supplychain.service.PartnerSupplychainLinkService in project axelor-open-suite by axelor.

the class StockMoveController method setInvoicedPartnerDomain.

/**
 * Called from stock move form view, on delivered partner select. Call {@link
 * PartnerSupplychainLinkService#computePartnerFilter}
 *
 * @param request
 * @param response
 */
public void setInvoicedPartnerDomain(ActionRequest request, ActionResponse response) {
    try {
        StockMove stockMove = request.getContext().asType(StockMove.class);
        String strFilter = Beans.get(PartnerSupplychainLinkService.class).computePartnerFilter(stockMove.getPartner(), PartnerSupplychainLinkTypeRepository.TYPE_SELECT_INVOICED_BY);
        response.setAttr("invoicedPartner", "domain", strFilter);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : StockMove(com.axelor.apps.stock.db.StockMove) PartnerSupplychainLinkService(com.axelor.apps.supplychain.service.PartnerSupplychainLinkService)

Example 2 with PartnerSupplychainLinkService

use of com.axelor.apps.supplychain.service.PartnerSupplychainLinkService in project axelor-open-suite by axelor.

the class SaleOrderController method setDeliveredPartnerDomain.

/**
 * Called from sale order form view, on delivered partner select. Call {@link
 * PartnerSupplychainLinkService#computePartnerFilter}
 *
 * @param request
 * @param response
 */
public void setDeliveredPartnerDomain(ActionRequest request, ActionResponse response) {
    try {
        SaleOrder saleOrder = request.getContext().asType(SaleOrder.class);
        String strFilter = Beans.get(PartnerSupplychainLinkService.class).computePartnerFilter(saleOrder.getClientPartner(), PartnerSupplychainLinkTypeRepository.TYPE_SELECT_DELIVERED_BY);
        response.setAttr("deliveredPartner", "domain", strFilter);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : PartnerSupplychainLinkService(com.axelor.apps.supplychain.service.PartnerSupplychainLinkService) SaleOrder(com.axelor.apps.sale.db.SaleOrder) AxelorException(com.axelor.exception.AxelorException)

Example 3 with PartnerSupplychainLinkService

use of com.axelor.apps.supplychain.service.PartnerSupplychainLinkService in project axelor-open-suite by axelor.

the class SaleOrderController method setInvoicedPartnerDomain.

/**
 * Called from sale order form view, on invoiced partner select. Call {@link
 * PartnerSupplychainLinkService#computePartnerFilter}
 *
 * @param request
 * @param response
 */
public void setInvoicedPartnerDomain(ActionRequest request, ActionResponse response) {
    try {
        SaleOrder saleOrder = request.getContext().asType(SaleOrder.class);
        String strFilter = Beans.get(PartnerSupplychainLinkService.class).computePartnerFilter(saleOrder.getClientPartner(), PartnerSupplychainLinkTypeRepository.TYPE_SELECT_INVOICED_BY);
        response.setAttr("invoicedPartner", "domain", strFilter);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : PartnerSupplychainLinkService(com.axelor.apps.supplychain.service.PartnerSupplychainLinkService) SaleOrder(com.axelor.apps.sale.db.SaleOrder) AxelorException(com.axelor.exception.AxelorException)

Aggregations

PartnerSupplychainLinkService (com.axelor.apps.supplychain.service.PartnerSupplychainLinkService)3 SaleOrder (com.axelor.apps.sale.db.SaleOrder)2 AxelorException (com.axelor.exception.AxelorException)2 StockMove (com.axelor.apps.stock.db.StockMove)1