Initial commit: OCA Mrp packages (117 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:05 +02:00
commit 277e84fd7a
4403 changed files with 395154 additions and 0 deletions

View file

@ -0,0 +1 @@
from . import hr_timesheet_switch

View file

@ -0,0 +1,23 @@
# Copyright 2019 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
class HrTimesheetSwitch(models.TransientModel):
_inherit = "hr.timesheet.switch"
@api.model
def _closest_suggestion(self):
"""Allow searching best suggestion by lead."""
context = self.env.context
if context.get("active_model") == "crm.lead":
return self.env["account.analytic.line"].search(
[
("employee_id", "in", self.env.user.employee_ids.ids),
("lead_id", "=", context.get("active_id", 0)),
],
order="date_time DESC",
limit=1,
)
return super()._closest_suggestion()