[IMP]project_working_time_task_portal:do not show exclude from sale order timesheet lines in timesheets portal

This commit is contained in:
2025-04-22 11:45:13 +02:00
parent 1da31fa1c2
commit 38b2adc06b
4 changed files with 15 additions and 15 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "project_working_time_task_portal", "name": "project_working_time_task_portal",
"version": "16.0.1.0.3", "version": "16.0.1.0.4",
"author": "Elabore", "author": "Elabore",
"website": "https://elabore.coop", "website": "https://elabore.coop",
"maintainer": "Boris Gallet", "maintainer": "Boris Gallet",

View File

@@ -1 +1 @@
from . import billable_time from . import billable_time, account_analytic_line

View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.osv import expression
class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
def _timesheet_get_portal_domain(self):
domain = super()._timesheet_get_portal_domain()
return expression.AND([domain, [('exclude_from_sale_order', '=', False)]])

View File

@@ -38,17 +38,4 @@
</th> </th>
</xpath> </xpath>
</template> </template>
<template id="portal_my_billables_timesheets" name="My Timesheets: Billable hours" inherit_id="hr_timesheet.portal_my_timesheets" >
<xpath expr="//t[@t-foreach='timesheets']" position="attributes">
<attribute name="t-if">not timesheet.exclude_from_sale_order</attribute>
</xpath>
</template>
<!-- <template id="portal_my_task_subtask_timesheet_table" name="My Task Subtask Timesheet Table: hide not billable" inherit_id="hr_timesheet.portal_subtask_timesheet_tables" priority="40"> -->
<!-- <xpath expr="//tr[@t-foreach='timesheets']" position="attributes"> -->
<!-- <attribute name="t-if">not timesheet.exclude_from_sale_order</attribute> -->
<!-- </xpath> -->
<!-- </template> -->
</odoo> </odoo>