Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3482 Переглядів

addons/base_import/static/src/jc/import_action.js

In these lines:

$fields.each(function (k,v) {
var filtered_data = self.generate_fields_completion(result, k);

var $thing = $();
var bind = function (d) {};
if (config.isDebug()) {
$thing = $(QWeb.render('ImportView.create_record_option')).insertAfter(v).hide();
bind = function (data) {
switch (data.type) {
case 'many2one': case 'many2many':
$thing.find('input').attr('field', data.id);
$thing.show();
break;
default:
$thing.find('input').attr('field', '').prop('checked', false);
$thing.hide();
}
}
}

I want to delete:

"if (config.isDebug()) {"

and

"}"

At the same time, save the code between these lines.

I don't want to change the original code, but I want to create a module that allows you to make these changes. How can I do this?

Аватар
Відмінити
Найкраща відповідь

Hi 

I don't think you will be able to change only part of function, I believe you'll have to override whole onpreview_success function where your lines of interest reside (you can copy and modify function as you need, or use super() call and then add additional logic that you need)

See https://www.odoo.com/documentation/10.0/howtos/web.html#modify-existing-widgets-and-classes how to do this.

 


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
трав. 24
1987
0
лип. 17
2819
2
бер. 17
4244
0
бер. 15
6397
1
лют. 24
2023