Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]web_responsive: fixed the issue of file viewer not display in form view. #3122

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web_responsive/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Web Responsive
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d09e54c7868a3255b5e7d2ec43ea85369b451ed086ba68870656418cf2f3c6bc
!! source digest: sha256:ea533185dffe3ba1545d17177bef364796c3b99afab4918dbd6d507ae68ace3b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down Expand Up @@ -179,6 +179,10 @@ Contributors

- Angel Patel <patelangel1414@gmail.com>

- `SerpentCS <https://www.serpentcs.com>`__:

- Parvez Qureshi <parvez.qureshi@serpentcs.com>

Maintainers
-----------

Expand Down
1 change: 1 addition & 0 deletions web_responsive/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def session_info(self):
user = self.env.user
return {
**session,
"displayFileViewer": user.display_file_viewer,
"apps_menu": {
"search_type": user.apps_menu_search_type,
"theme": user.apps_menu_theme,
Expand Down
1 change: 1 addition & 0 deletions web_responsive/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ResUsers(models.Model):
store=True,
readonly=False,
)
display_file_viewer = fields.Boolean()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a help to explain what this field does


@api.depends("action_id")
def _compute_redirect_home(self):
Expand Down
3 changes: 3 additions & 0 deletions web_responsive/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
- Taras Shabaranskyi \<<shabaranskij@gmail.com>\>

- Angel Patel \<<patelangel1414@gmail.com>\>

- [SerpentCS](https://www.serpentcs.com):
- Parvez Qureshi \<<parvez.qureshi@serpentcs.com>\>
6 changes: 5 additions & 1 deletion web_responsive/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Web Responsive</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d09e54c7868a3255b5e7d2ec43ea85369b451ed086ba68870656418cf2f3c6bc
!! source digest: sha256:ea533185dffe3ba1545d17177bef364796c3b99afab4918dbd6d507ae68ace3b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/17.0/web_responsive"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_responsive"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds responsiveness to web backend.</p>
Expand Down Expand Up @@ -496,6 +496,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Taras Shabaranskyi &lt;<a class="reference external" href="mailto:shabaranskij&#64;gmail.com">shabaranskij&#64;gmail.com</a>&gt;</li>
<li>Angel Patel &lt;<a class="reference external" href="mailto:patelangel1414&#64;gmail.com">patelangel1414&#64;gmail.com</a>&gt;</li>
<li><a class="reference external" href="https://www.serpentcs.com">SerpentCS</a>:<ul>
<li>Parvez Qureshi &lt;<a class="reference external" href="mailto:parvez.qureshi&#64;serpentcs.com">parvez.qureshi&#64;serpentcs.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
4 changes: 4 additions & 0 deletions web_responsive/static/src/views/form/form_renderer.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

import {patch} from "@web/core/utils/patch";
import {FormRenderer} from "@web/views/form/form_renderer";
import {session} from "@web/session";

export const unpatchDisableFilePreview = patch(FormRenderer.prototype, {
/** @returns {Boolean}*/
hasFileViewer() {
if (session.displayFileViewer) {
return super.hasFileViewer();
}
return false;
},
});
2 changes: 0 additions & 2 deletions web_responsive/static/src/views/form/form_statusbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
overflow: unset;

.o_form_sheet {
overflow: auto;

&::-webkit-scrollbar {
width: 10px;
height: 10px;
Expand Down
1 change: 1 addition & 0 deletions web_responsive/views/res_users_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<data>
<field name="action_id" position="after">
<field name="is_redirect_home" invisible="action_id" />
<field name="display_file_viewer" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it has an incorrect indentation

</field>
</data>
</field>
Expand Down