Odoo Help

0

0
9 Answers
1
Avatar

Odoo Tools สหพันธรัฐรัสเซีย

--Odoo Tools--
10440
| 6 3 9
St Petersburg, สหพันธรัฐรัสเซีย
--Odoo Tools--

OdooTools is the team of developers and business analysts to help you extend Odoo potential. We have been communicating with end users to whom the software became the main business tool since 2012. As a result, we are proud of dozens of successful Odoo apps developed. We are open for new ideas and challenges to create the best Odoo tools for business needs all over the world.

The apps you may like to implement in your Odoo

KnowSystem - the tool to build deep and structured knowledge base for internal and external use

OwnCloud / NextCloud Odoo Integration - the tool to automatically synchronize Odoo attachments with OwnCloud / NextCloud files in both ways

Joint Calendar - the tool to combine different Odoo events in a few configurable calendars

Google Drive Odoo Integration - the tool to automatically synchronize Odoo attachments with Google Drive files in both ways

Product Management Interface - the tool to search, select and update product templates in batch

OneDrive / SharePoint Odoo Integration - the tool to automatically synchronize Odoo attachments with OneDrive files in both ways

Periodic Reporting and Reminders - the tool to generate and periodically send reports and reminders

--> More apps
Odoo Tools สหพันธรัฐรัสเซีย
12/12/18 09:02

Hi,

Do you speak about the top entry 'attachments'?

If so, the js is placed in document/static/src/js/document.js. Here is the method '_onFileUploaded'. After that you can trigger reload of a form or of the whole window (the most generic is location.reload)

7 ความคิดเห็น
Wided ตูนีเซีย
14/12/18 06:08

Thanks, that's what I'm looking for, but I can't make it work. Here's my javascript file:

odoo.define('mymodule.document', function (require){

"use strict";

var core = require('web.core');

var Dialog = require('web.Dialog');

var framework = require('web.framework');

var Sidebar = require('web.Sidebar');

var field_utils = require('web.field_utils');

var _t = core._t;

var document = require('document.document');

document.include({

_onFileUploaded: function () {

var attachments = Array.prototype.slice.call(arguments, 1);

var uploadErrors = _.filter(attachments, function (attachment) {

return attachment.error;

});

if (uploadErrors.length) {

this.do_warn(_t('Uploading Error'), uploadErrors[0].error);

}

this._updateAttachments().then(this._redraw.bind(this));

framework.unblockUI();

location.reload();

}

});

}

Odoo Tools สหพันธรัฐรัสเซีย
14/12/18 06:17

Hi, you should upgrade not document.document, but 'Sidebar' which is overwritten in 'document.document'. So, something like

Sidebar.include({

_onFileUploaded: function () {

this._super.apply(this, arguments);

window.location.reload();

});

});

Odoo Tools สหพันธรัฐรัสเซีย
14/12/18 06:21

and var Sidebar = require('document.Sidebar');

Wided ตูนีเซีย
14/12/18 08:14

Unfortunately, this does not work. I think that this file is not even loaded because I added the line:

console.log('myfile.js');

And I don't see anything in the logs.

Odoo Tools สหพันธรัฐรัสเซีย
14/12/18 08:24
Wided ตูนีเซีย
14/12/18 08:48

Yes, I imported it. Sorry but I forgot to tell you that I am getting a blank page when I login, I only get the full menu when I comment the line that imports the assets file in __manifest__.py or when I put in the address ba ?debug=assets.

Odoo Tools สหพันธรัฐรัสเซีย
14/12/18 08:55

1. Try to clean your browser cashe. 2. Turn on the browser to save logs. ('preserve logs' of console). 3. Look at logs. There must be some error which should be fixed

0
Wided ตูนีเซีย
14/12/18 08:49

Yes, I imported it. Sorry but I forgot to tell you that I am getting a blank page when I login, I only get the full menu when I comment the line that imports the assets file in __manifest__.py or when I put in the address ba ?debug=assets.

Ask a Question
Writer
ป้ายกำกับ
Keep Informed
2 ผู้ติดตาม
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now