Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] pos_order_to_sale_order: rpc helper #1260

Draft
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

danielduqma
Copy link
Contributor

@danielduqma danielduqma commented Oct 30, 2024

rpc attribute used comes from LegacyComponent, that is deprecated and throws an error in some specific cases. Changing it by this.env.services works properly in all cases.

This can be reproduced executing this from other component:

const create_order = new CreateOrderPopup(props, this.env);
const {sale_order_id} = await create_order._createSaleOrder("draft");

FL-556-4346

`rpc` attribute used comes from LegacyComponent, that is deprecated
and throws an error in some specific cases. Changing it by
`this.env.services` works properly in all cases.
@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@legalsylvain
Copy link
Contributor

Hi. Do you mean it should be changed in all modules ?

rgrep "this\.rpc" ./ --include=*.js
./pos_order_to_sale_order/static/src/js/CreateOrderPopup.js:            return await this.rpc({
./pos_product_label/static/src/PrintLabelPopup.esm.js:            const data = await this.rpc({
./pos_product_label/static/src/PrintLabelPopup.esm.js:        const response = await this.rpc({
./pos_partner_firstname/static/src/js/PartnerDetailsEdit.js:                this.rpc({
./pos_financial_risk/static/src/js/PaymentScreen.esm.js:            this.rpc({
./pos_order_to_sale_order_delivery/static/src/js/Popups/CreateOrderPopup.esm.js:    const response = await this.rpc({
./pos_partner_location_google_map/static/src/js/PartnerMapGoogleEdit.esm.js:            return this.rpc({
./pos_lot_barcode/static/src/js/Screens/ProductScreen.js:                    foundLotIds = await this.rpc({
./pos_order_to_sale_order_sale_financial_risk/static/src/js/CreateOrderPopup.esm.js:            const [partnerRiskValues] = await this.rpc({
./pos_loyalty_redeem_payment/static/src/js/PaymentScreen.esm.js:                const payload = await this.rpc({

rgrep "this\.env\.services\.rpc" ./ --include=*.js
./pos_lot_selection/static/src/js/models.js:                    return await this.env.services.rpc(
./pos_loyalty_redeem_payment/static/src/js/PaymentScreen.esm.js:            return await this.env.services.rpc({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants