Solution 1: Display All Employees
To display all employees regardless of whether they have shifts on a particular date, you'll likely need to customize the gantt view. This may require extending the existing views or creating a new view to override the default behavior. This approach might involve some technical development work.
Solution 2: Display Employees Without Shifts
To display only employees who don't have shifts on a particular date, you can follow these steps:
Create a Custom View:
You can create a custom view for the gantt chart that filters employees based on their shifts. This will require creating a new view definition in XML.
Add Filter Criteria:
In the custom view definition, you can add a domain to filter the employees displayed in the gantt chart. The domain should be constructed to exclude employees with shifts on the selected date.
-->example of what the XML code might look like:
record id="view_custom_planning_gantt" model="" rel="ugc">ir.ui.view">
field name="name">Custom Planning Gantt
field name="model">resource.calendar.attendance
field name="inherit_id" ref="planning.planning_gantt_view"/>
field name="arch" type="xml">
xpath expr="//ganttview" position="attributes">
attribute name="default_domain">[('date', '!=', selected_date)]
/xpath>
/field>
/record>
In this example, replace selected_date with the actual date you want to filter by.
Activate the Custom View:
After defining the custom view, activate it in your module. This will ensure that the view is used when displaying the gantt chart in the Planning module.
@chantrie,
Hi,
Any idea how to accomplish this?
Thanks