Skip to content

Commit

Permalink
Merge PR #560 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 4, 2023
2 parents 42f6cb9 + 716d70b commit 0132c81
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
1 change: 1 addition & 0 deletions vault/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"data": [
"security/ir.model.access.csv",
"security/ir_rule.xml",
"security/vault_security.xml",
"views/res_config_settings_views.xml",
"views/res_users_views.xml",
"views/vault_entry_views.xml",
Expand Down
6 changes: 6 additions & 0 deletions vault/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

module_vault_share = fields.Boolean()
group_vault_export = fields.Boolean(
"Export Vaults", implied_group="vault.group_vault_export"
)
group_vault_import = fields.Boolean(
"Import Vaults", implied_group="vault.group_vault_import"
)
13 changes: 13 additions & 0 deletions vault/security/vault_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="group_vault_export" model="res.groups">
<field name="name">Allow to export vaults</field>
<field name="category_id" ref="base.module_category_hidden" />
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>
<record id="group_vault_import" model="res.groups">
<field name="name">Allow to import vaults</field>
<field name="category_id" ref="base.module_category_hidden" />
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>
</odoo>
22 changes: 22 additions & 0 deletions vault/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="vault_share">
<div class="o_setting_left_pane">
<field name="group_vault_import" />
</div>
<div class="o_setting_right_pane">
<label for="group_vault_import" />
<div class="text-muted">
Allow all users to import vaults accessible to them
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" id="vault_share">
<div class="o_setting_left_pane">
<field name="group_vault_export" />
</div>
<div class="o_setting_right_pane">
<label for="group_vault_export" />
<div class="text-muted">
Allow all users to export vaults accessible to them
</div>
</div>
</div>
</div>
</div>
</field>
Expand Down
2 changes: 2 additions & 0 deletions vault/views/vault_entry_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
type="object"
name="action_open_import_wizard"
string="Import from file"
groups="vault.group_vault_import"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
groups="vault.group_vault_export"
/>
</header>
<sheet>
Expand Down
7 changes: 2 additions & 5 deletions vault/views/vault_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@
type="object"
name="action_open_import_wizard"
string="Import from file"
groups="vault.group_vault_import"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
/>
<button
type="object"
name="action_open_export_wizard"
string="Export to file"
groups="vault.group_vault_export"
/>
<button name="vault_verify" string="Verify" />
<button
Expand Down

0 comments on commit 0132c81

Please sign in to comment.