تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3580 أدوات العرض

odoo.define('test_payment.test_checkout_form',  require => {    'use strict';
    const PaymentCheckoutForm = require('payment.checkout_form');
    const paymentFormMixin = require('payment.payment_form_mixin');
    const manageForm = require('payment.manage_form');
    const publicWidget = require('web.public.widget');

    const test_Mixin = {        

​_prepareInlineForm: function (code, paypaymentOptionId, flow){  

          ​if(code != "test"){

                ​ return this._super(...arguments);

​                   }            

​console.log("abcdefghijklmop")        

​}    

​}    

PaymentCheckoutForm.include(test_Mixin);    

manageForm.include(test_Mixin);});



I want to try to replicate the payment_form.js of the payment_adyen to understand the usage of _prepareInlineForm, but i get this error, i don't understand what i am missing. I am working with Odoo 16. Thanks in advance for the time you will take for my answer.

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Hello, Cybrosys Techno Solutions Pvt.Ltd thanks for the anwsers, in your exemple you extends the NumberPopup, in my case, the function  _prepareInlineForm is not in a class. How can i adapt your solution to match my case? And do you have more information about the Owl method?



الصورة الرمزية
إهمال
أفضل إجابة

Hi,

In odoo 16, the Owl method is used for JS. In your current code, you are using the backbone method.So you need to migrate your code to OWL for the correct working.
You can refer to the blog below to get an idea of OWL

https://www.cybrosys.com/blog/how-to-create-custom-number-popup-in-odoo-16-pos-using-owl


Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 24
1739
0
يوليو 24
756
1
أغسطس 24
682
1
يوليو 24
813
0
أبريل 24
815