Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_alfresco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_alfresco
Commits
f582c6a2
Commit
f582c6a2
authored
4 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[update] gestion erreur objectNotFound Alfresco
parent
494f21a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/src/js/form_widgets.js
+42
-0
42 additions, 0 deletions
static/src/js/form_widgets.js
with
42 additions
and
0 deletions
static/src/js/form_widgets.js
+
42
−
0
View file @
f582c6a2
...
@@ -8,6 +8,7 @@ odoo.define('cgscop_alfresco.form_widgets', function(require) {
...
@@ -8,6 +8,7 @@ odoo.define('cgscop_alfresco.form_widgets', function(require) {
var
core
=
require
(
'
web.core
'
);
var
core
=
require
(
'
web.core
'
);
var
form_widgets
=
require
(
'
cmis_web.form_widgets
'
);
var
form_widgets
=
require
(
'
cmis_web.form_widgets
'
);
var
lf_form_widgets
=
require
(
'
lefilament_alfodoo.form_widgets
'
);
var
session
=
require
(
'
web.session
'
);
var
session
=
require
(
'
web.session
'
);
form_widgets
.
CmisObjectWrapper
.
include
({
form_widgets
.
CmisObjectWrapper
.
include
({
...
@@ -97,4 +98,45 @@ odoo.define('cgscop_alfresco.form_widgets', function(require) {
...
@@ -97,4 +98,45 @@ odoo.define('cgscop_alfresco.form_widgets', function(require) {
},
},
});
});
lf_form_widgets
.
CmisMetadataDialog
.
include
({
/*
* Surcharge la fonction on_click_metadata
* pour la gestion des erreurs spécifique à la CG Scop
*/
on_click_metadata
:
function
()
{
var
self
=
this
;
this
.
metadata
=
{
'
cmis:name
'
:
Date
.
now
().
toString
()
+
'
_
'
+
this
.
file
.
name
}
_
.
each
(
this
.
parent_metadata
,
function
(
meta
)
{
if
(
meta
.
value
)
{
self
.
metadata
[
meta
.
name
]
=
meta
.
value
;
}
else
if
(
meta
.
field_value
)
{
self
.
metadata
[
meta
.
name
]
=
self
.
record
[
meta
.
field_value
];
}
else
{
self
.
metadata
[
meta
.
name
]
=
self
.
$el
.
find
(
"
#
"
+
meta
.
name
.
replace
(
"
:
"
,
"
-
"
))[
0
].
value
;
}
});
this
.
cmis_session
.
createDocument
(
this
.
parent_cmisobject
.
objectId
,
this
.
file
,
this
.
metadata
,
this
.
file
.
mimeType
)
.
ok
(
function
(
new_cmisobject
)
{
self
.
getParent
().
trigger
(
'
cmis_node_created
'
,
[
new_cmisobject
]);
self
.
$el
.
parents
(
'
.modal
'
).
modal
(
'
hide
'
);
})
.
notOk
(
function
(
error
)
{
console
.
log
(
error
)
if
(
error
)
{
console
.
error
(
error
.
text
);
if
(
error
.
type
==
'
application/json
'
)
{
var
jerror
=
JSON
.
parse
(
error
.
text
);
if
(
jerror
.
exception
===
'
objectNotFound
'
)
{
self
.
getParent
().
refresh_datatable
();
self
.
$el
.
parents
(
'
.modal
'
).
modal
(
'
hide
'
);
return
;
}
}
}
});
},
});
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment