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

Syncing from upstream OCA/web (14.0) #1202

Merged
merged 3 commits into from
Jan 24, 2024
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ addon | version | maintainers | summary
[web_drop_target](web_drop_target/) | 14.0.1.1.2 | | Allows to drag files into Odoo
[web_edit_user_filter](web_edit_user_filter/) | 14.0.1.0.1 | | Edit User Filters
[web_environment_ribbon](web_environment_ribbon/) | 14.0.1.0.0 | | Web Environment Ribbon
[web_field_required_invisible_manager](web_field_required_invisible_manager/) | 14.0.2.3.1 | [![ilyasProgrammer](https://github.com/ilyasProgrammer.png?size=30px)](https://github.com/ilyasProgrammer) | Web Field Required Invisible Readonly Managerr
[web_field_required_invisible_manager](web_field_required_invisible_manager/) | 14.0.2.3.2 | [![ilyasProgrammer](https://github.com/ilyasProgrammer.png?size=30px)](https://github.com/ilyasProgrammer) | Web Field Required Invisible Readonly Managerr
[web_fix_modules_load](web_fix_modules_load/) | 14.0.1.0.0 | [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) | Fix translations loading from frontend with many modules
[web_group_expand](web_group_expand/) | 14.0.1.0.0 | | Group Expand Buttons
[web_ir_actions_act_multi](web_ir_actions_act_multi/) | 14.0.1.0.1 | | Enables triggering of more than one action on ActionManager
Expand Down
2 changes: 1 addition & 1 deletion web_field_required_invisible_manager/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Web Field Required Invisible Readonly Managerr
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:821ec36cd3e94e2aa77851b8f49865542e8ac792ece8aa45b25065bcbc01f60c
!! source digest: sha256:c3e10557515edab148f1f12acd57d30f86cae0cebdb503fa58989784935a3ddb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion web_field_required_invisible_manager/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "Web Field Required Invisible Readonly Managerr",
"category": "Web",
"version": "14.0.2.3.1",
"version": "14.0.2.3.2",
"license": "AGPL-3",
"author": "Ilyas, ooops404, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
Expand Down
5 changes: 3 additions & 2 deletions web_field_required_invisible_manager/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def fields_view_get(
return arch

def process_child_fields(self, arch, view_type):
"""Collect all relational fields and update its views"""
"""Collect all relational fields and update their views"""
related_fields = [
(k, v.comodel_name) for k, v in self._fields.items() if v.comodel_name
]
Expand Down Expand Up @@ -80,7 +80,8 @@ def process_child_fields(self, arch, view_type):
z_arch = self.create_restrictions_fields(
restr, view_type, z_arch
)
z_arch["arch"] = z_arch["arch"].decode("utf-8")
if type(z_arch["arch"]) is bytes:
z_arch["arch"] = z_arch["arch"].decode("utf-8")
name_manager = NameManager(False, self.env[restr.model_name])
if restr.readonly_field_id and restr.readonly_model_id:
model_field_infos = name_manager.fields_get.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">Web Field Required Invisible Readonly Managerr</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:821ec36cd3e94e2aa77851b8f49865542e8ac792ece8aa45b25065bcbc01f60c
!! source digest: sha256:c3e10557515edab148f1f12acd57d30f86cae0cebdb503fa58989784935a3ddb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/14.0/web_field_required_invisible_manager"><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-14-0/web-14-0-web_field_required_invisible_manager"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to set a field required, invisible or readonly for users belonging to a specific group.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def setUpClass(cls):
"<field name='name'/></tree>",
}
)
cls.view_users_form_arch_orig = cls.view_users_form.arch
cls.view_users_form.arch = cls.view_users_form.arch.replace(
"</notebook>",
"</notebook><field name='company_ids'><tree><field name='city'/>"
Expand Down Expand Up @@ -220,3 +221,11 @@ def test_all_web_field_required_invisible_manager(self):
self.assertTrue(self.invisible_title_rec_id.required)
# unlink
self.invisible_rec_id.unlink()
# case when child view has no fields
self.view_users_form.arch = self.view_users_form_arch_orig
self.view_users_form.arch = self.view_users_form.arch.replace(
"</notebook>",
"</notebook><field name='company_ids'><form><br/></form></field>",
)
self.env.user.fields_view_get(view_id=self.view_users_form.id, view_type="form")
self.env.user.fields_view_get(view_id=self.view_users_tree.id, view_type="tree")
Loading