-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix javascript code of smile_web_impex
Using a callback to evaluate whether the button should be hidden does not always work. The callback is not guaranteed to be called instantaneously. For example, when refreshing the screen, the export button disapears. Instead, use the session to store flags to indicate whether the user is member of the import/export groups.
- Loading branch information
1 parent
048c1a9
commit 17c9e6d
Showing
4 changed files
with
29 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# (C) 2019 Smile (<http://www.smile.fr>) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# (C) 2019 Smile (<http://www.smile.fr>) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
from . import ( | ||
ir_http, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# (C) 2019 Smile (<http://www.smile.fr>) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class IrHttp(models.AbstractModel): | ||
|
||
_inherit = 'ir.http' | ||
|
||
def session_info(self): | ||
result = super().session_info() | ||
result['has_group_smile_import'] = self.env.user.has_group('smile_web_impex.group_import') | ||
result['has_group_smile_export'] = self.env.user.has_group('smile_web_impex.group_export') | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters