跳至内容
菜单
此问题已终结
6284 查看

I tried this code:

odoo.define('oepetstore.payment_widget', function (require) {

"use strict";

var payment_widget = require('account.account_payment_widget');

}); 


but I got this error: 

Missing dependencies: ["account.account_payment_widget"]

Non loaded modules: ["oepetstore.payment_widget"] 

形象
丢弃
编写者

I'm replaced var payment_widget = require('account.account_payment_widget'); by var payment_widget = require('account.payment'); and show this message in console: undefined

Can I know, even after replacing require('account.account_payment_widget') with require('account.payment') , are you getting the same error in browser console?

If you want to inherit the existing widget, then you should do it using

var PaymentWidget = core.form_widget_registry.get('payment');

var PaymentWidgetExtended = PaymentWidget.extend({

.

.

functions you want to inherit

.

.

.

});

编写者

Hi Asmita, thanks for answer the question, specifically I'm trying to inherit the ShowPaymentLineWidget defined in account.payment class in account_payment_widget.js (account module) when i try to call this class (with var payment_widget = require('account.payment');) I got this message "undefined" at console, I tried your example and this is good for me, but making a little change this way PaymentWidget.include({...})

相关帖文 回复 查看 活动
0
8月 23
194
1
2月 22
2563
0
8月 18
5552
1
11月 24
1387
1
9月 23
4324