Skip to content

Commit

Permalink
[IMP] sale_timesheet_line_exclude: add security group
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Aug 18, 2024
1 parent d9de684 commit 0cde366
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sale_timesheet_line_exclude/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
"application": False,
"summary": "Exclude Timesheet Line from Sale Order",
"depends": ["sale_timesheet"],
"data": ["views/account_analytic_line.xml", "views/project_task.xml"],
"data": [
"security/exclude_from_sale_order.xml",
"views/account_analytic_line.xml",
"views/project_task.xml",
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AccountAnalyticLine(models.Model):
exclude_from_sale_order = fields.Boolean(
string="Non-billable",
help="Checking this would exclude this timesheet entry from Sale Order",
groups="sale_timesheet_line_exclude.group_exclude_from_sale_order",
)

@api.constrains("exclude_from_sale_order")
Expand Down
11 changes: 11 additions & 0 deletions sale_timesheet_line_exclude/security/exclude_from_sale_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright ACSONE SA/NV (https://acsone.eu)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="group_exclude_from_sale_order" model="res.groups">
<field name="name">Exclude timesheets from sale order</field>
<field name="category_id" ref="base.module_category_hidden" />
</record>
</odoo>

0 comments on commit 0cde366

Please sign in to comment.