summaryrefslogtreecommitdiff
path: root/addons/hr_expense/static/src
diff options
context:
space:
mode:
authorThomas Carlier <thc@odoo.com>2019-09-17 08:53:31 +0000
committerThomas Carlier <thc@odoo.com>2020-01-28 14:41:37 +0000
commit4eeeb4f172c10f2a8e190fb9afcf440ddaaf5d34 (patch)
tree5ccb655f73dbcf69d576278a49f6ed48380e0250 /addons/hr_expense/static/src
parentb5d608036654189a1d233236d3b1f1319c92e0e2 (diff)
[ADD] hr_expense : add the ability to install OCR module
- if checked in settings, OCR can be used to get infos from the attached receipt image - set default product to EXP_GEN when created from picture - use "register_as_main attachment" when expenses are created from receipt images - Add the upload button to the kanban view to see it immediately in the mobile version and use it to create expenses from pictures. (with or without OCR installed) closes odoo/odoo#39559 Related: odoo/enterprise#6493 Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Diffstat (limited to 'addons/hr_expense/static/src')
-rw-r--r--addons/hr_expense/static/src/js/upload_mixin.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/hr_expense/static/src/js/upload_mixin.js b/addons/hr_expense/static/src/js/upload_mixin.js
index c94df1c6616..4f6660c8039 100644
--- a/addons/hr_expense/static/src/js/upload_mixin.js
+++ b/addons/hr_expense/static/src/js/upload_mixin.js
@@ -2,6 +2,7 @@ odoo.define('hr_expense.documents.upload.mixin', function (require) {
"use strict";
var core = require('web.core');
+var config = require('web.config');
var _t = core._t;
var qweb = core.qweb;
@@ -43,11 +44,13 @@ var DocumentUploadMixin = {
if (!attachent_ids.length) {
return self.do_notify(_t("Error"), _t("An error occurred during the upload"));
}
+ var myContext = this.initialState.context
+ myContext['isMobile'] = config.device.isMobile
return this._rpc({
model: 'hr.expense',
method: 'create_expense_from_attachments',
args: ["", attachent_ids, this.viewType],
- context: this.initialState.context,
+ context: myContext,
}).then(function(result) {
self.do_action(result);
});