콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

I need help regarding javascript logic in odoo16.

First of all, when I start before creating an order, I need to show the PartnerListCream view to select the client before proceeding to create the order.

I got it to work, but now if the cashier has a pin it does not show me the view so I can add the cashier's pin and start the flow of selecting a customer and then creating the order attached to what I did.


odoo.define("pos_customer_required.ProductScreen", function (require) {
    "use strict";
    console.log("SE cargo3");
    const ProductScreen = require("point_of_sale.ProductScreen");
    const Registries = require("point_of_sale.Registries");
    const PartnerListScreen = require("point_of_sale.PartnerListScreen"); 
    const { useListener } = require("@web/core/utils/hooks");


    // Registries.Component.extend(ProductScreen, PosRequiredCustomerProductScreen,PartnerListScreen);

    const PosRequiredCustomerProductScreen = (ProductScreen) =>
        class extends ProductScreen {
            onMounted() {
              console.log("Start -----TESTT");
              if (this.env.pos.config.require_customer === "order") {
                this.onClickPartner();
              };
            }

        };


  
    Registries.Component.extend(ProductScreen, PosRequiredCustomerProductScreen);

    return PosRequiredCustomerProductScreen;
});

require_customer is a parameter that I create as a configuration that if active, it is required to select a customer before creating the order and the onClickPartner() method is native to Odoo, it is the event that simulates to open the view and select a customer.

Finally, as I mentioned, the view to select the customer appears before creating the order, but at no time does it now show me the view to place the cashier's pin.


아바타
취소
관련 게시물 답글 화면 활동
3
12월 23
6720
1
8월 23
2381
2
7월 23
4147
3
3월 25
8402
1
6월 24
3552