21 lines
670 B
Python
21 lines
670 B
Python
# Copyright 2026 Criptomart
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import api, models
|
|
|
|
|
|
class Sheet(models.Model):
|
|
_inherit = "hr_timesheet.sheet"
|
|
|
|
def _with_sheet_recompute(self):
|
|
"""Hook for extensions"""
|
|
token = self.env["account.analytic.line"]._sheet_recompute_token()
|
|
return self.with_context(sheet_recompute=token)
|
|
|
|
@api.model_create_multi
|
|
def create(self, vals_list):
|
|
sheets = super(Sheet, self._with_sheet_recompute()).create(vals_list)
|
|
return sheets.with_env(self.env)
|
|
|
|
def write(self, vals):
|
|
return super(Sheet, self._with_sheet_recompute()).write(vals)
|