This question has been flagged
1 Reply
2722 Views

Hello, I want to automate the Import process. I am trying to modify the base_import module.

But I dont know when the csv file is passed to this module.

I found in the controller.py file  the "set_file" function, but i dont found where this function is called and which parameters  may i pass.

Thanks

Avatar
Discard
Best Answer

@Francisco Tobar

That function set_file is called using the url like: http://localhost:8069/base_import/set_file
defined in the route decorator like:

@route('/base_import/set_file')
def set_file(self, req, file, import_id, jsonp='callback'):

and used in the base_import/static/src/js/import.js

//- File & settings change section

onfile_loaded: function () {

this.$('.oe_import_button, .oe_import_file_reload')

.prop('disabled', true);

if (!this.$('input.oe_import_file').val()) { return; }

this.$el.removeClass('oe_import_preview oe_import_error');

jsonp(this.$el, {

url: '/base_import/set_file'

}, this.proxy('settings_changed'));

},

Hope that will help you

Avatar
Discard
Author

Thanks for your answer. But i dont know where the parameters are passed. I need to know where the csv file is loaded. Thanks

The csv is loaded in the import form