Skip to content

Commit 8023625

Browse files
committed
[FIX] sql_export_mail : do not raise an error if non admin user want to access to sql export
1 parent 889cc4b commit 8023625

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sql_export_mail/models/sql_export.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ class SqlExport(models.Model):
2020
"need to link the sql query with a cron to send mail automatically",
2121
)
2222
cron_ids = fields.Many2many(
23-
"ir.cron", "cron_sqlquery_rel", "sql_id", "cron_id", "Crons"
23+
"ir.cron",
24+
"cron_sqlquery_rel",
25+
"sql_id",
26+
"cron_id",
27+
"Crons",
28+
groups="base.group_system",
2429
)
2530
# We could implement other conditions, that is why it is a selection field
2631
mail_condition = fields.Selection(

sql_export_mail/views/sql_export_view.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<field
1919
name="mail_condition"
2020
attrs="{'invisible': [('cron_ids', '=', [(6, False, [])])]}"
21+
groups="base.group_system"
2122
/>
2223
</field>
2324
<page name="page_sql" position="after">
@@ -30,7 +31,7 @@
3031
colspan="2"
3132
/>
3233
</group>
33-
<group string="Crons">
34+
<group string="Crons" groups="base.group_system">
3435
<field
3536
name="cron_ids"
3637
nolabel="1"

0 commit comments

Comments
 (0)