Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1314 Visualizzazioni

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.


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
dic 23
6130
1
ago 23
2100
2
lug 23
3568
3
mar 25
7144
1
giu 24
2810