-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] dms: Allow share (directories and files) without 'Contact creat…
…ion' permission Extra changes: Replace Share buttons with actions Steps to reproduce: - Go to Settings > Users & Companies > Users and create a user only with Documents > Manager permission. (User must not have the Extra Rights > Contact Creation permission). - Go to Documents and go into a directory form view and click on "Share" button. - An access error is displayed
- Loading branch information
1 parent
e4740d6
commit a60156e
Showing
8 changed files
with
52 additions
and
12 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
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
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
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
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
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 +1,2 @@ | ||
from . import wizard_dms_file_move | ||
from . import wizard_dms_share |
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,19 @@ | ||
# Copyright 2024 Tecnativa - Víctor Martínez | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class WizardDmsShare(models.TransientModel): | ||
_name = "wizard.dms.share" | ||
_inherit = "portal.share" | ||
_description = "Wizard for sharing DMS records" | ||
|
||
@api.model | ||
def _selection_target_model(self): | ||
return [ | ||
(model.model, model.name) | ||
for model in self.env["ir.model"] | ||
.sudo() | ||
.search([("model", "in", ("dms.directory", "dms.file"))]) | ||
] |
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,28 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="wizard_dms_share_form" model="ir.ui.view"> | ||
<field name="name">wizard.dms.share.form</field> | ||
<field name="model">wizard.dms.share</field> | ||
<field name="inherit_id" ref="portal.portal_share_wizard" /> | ||
<field name="mode">primary</field> | ||
<field name="arch" type="xml"> | ||
<field name="res_model" position="attributes"> | ||
<attribute name="invisible">1</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="wizard_dms_directory_share_action" model="ir.actions.act_window"> | ||
<field name="name">Share</field> | ||
<field name="res_model">wizard.dms.share</field> | ||
<field name="binding_model_id" ref="model_dms_directory" /> | ||
<field name="view_mode">form</field> | ||
<field name="target">new</field> | ||
</record> | ||
<record id="wizard_dms_file_share_action" model="ir.actions.act_window"> | ||
<field name="name">Share</field> | ||
<field name="res_model">wizard.dms.share</field> | ||
<field name="binding_model_id" ref="model_dms_file" /> | ||
<field name="view_mode">form</field> | ||
<field name="target">new</field> | ||
</record> | ||
</odoo> |