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
5113a75c
Commit
5113a75c
authored
5 years ago
by
Benjamin
Browse files
Options
Downloads
Patches
Plain Diff
modification retour wizard
parent
8ba057af
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wizard/add_file_wizard.py
+10
-10
10 additions, 10 deletions
wizard/add_file_wizard.py
wizard/add_file_wizard.xml
+2
-3
2 additions, 3 deletions
wizard/add_file_wizard.xml
with
12 additions
and
13 deletions
wizard/add_file_wizard.py
+
10
−
10
View file @
5113a75c
...
...
@@ -8,6 +8,11 @@ from odoo.tools.mimetypes import guess_mimetype
class
AddFileWizard
(
models
.
TransientModel
):
"""
Wizard d
'
ajout de fichier dans la GED
Récupère automatiquement depuis Alfresco les valeurs de periode,
type et validité ainsi que l
'
organisme associé
"""
_name
=
'
add.file.wizard
'
_inherit
=
'
connector.alfresco
'
_description
=
"
Ajout de fichier dans Alfresco
"
...
...
@@ -49,6 +54,10 @@ class AddFileWizard(models.TransientModel):
@api.multi
def
add_file
(
self
):
"""
Ajoute un fichier sur la GED Alfresco
@return: fonction get_partner_files() de res.partner
"""
content_type
=
mimetypes
.
guess_type
(
self
.
filename
)
if
content_type
[
0
]:
content_type
=
content_type
[
0
]
...
...
@@ -63,13 +72,4 @@ class AddFileWizard(models.TransientModel):
mimetype
=
content_type
,
doc
=
self
.
file
.
decode
(
'
utf-8
'
))
return
{
"
type
"
:
"
ir.actions.act_window
"
,
"
name
"
:
"
Fichiers liés
"
,
"
res_model
"
:
"
alfresco.partner.files
"
,
"
views
"
:
[[
False
,
"
tree
"
]],
"
target
"
:
"
main
"
,
"
search_view_id
"
:
self
.
env
.
ref
(
"
connector_alfresco.alfresco_partner_files_search
"
).
id
,
}
return
self
.
partner_id
.
get_partner_files
()
This diff is collapsed.
Click to expand it.
wizard/add_file_wizard.xml
+
2
−
3
View file @
5113a75c
...
...
@@ -14,11 +14,10 @@
</group>
<group>
<field
name=
"filename"
invisible=
"1"
/>
<field
name=
"content_type"
invisible=
"1"
/>
<field
name=
"file"
filename=
"filename"
content_type=
"content_type"
required=
"1"
/>
<field
name=
"file"
filename=
"filename"
required=
"1"
/>
</group>
<footer>
<button
class=
"btn btn-sm btn-primary"
name=
"add_file"
string=
"Ajouter"
type=
"object"
confirm=
"Êtes-vous sûr de vouloir ajouter ce fichier ?"
/>
<button
class=
"btn btn-sm btn-primary"
name=
"add_file"
string=
"Ajouter"
type=
"object"
confirm=
"Êtes-vous sûr
(e)
de vouloir ajouter ce fichier ?"
/>
<button
class=
"btn btn-sm btn-default"
special=
"cancel"
string=
"Fermer"
/>
</footer>
</form>
...
...
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