-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] hr_timesheet_analytic_tag: Migration to 18.0
- Loading branch information
Showing
7 changed files
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Copyright 2023 Tecnativa - Víctor Martínez | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from odoo import Command, models | ||
from odoo import Command, api, models | ||
|
||
|
||
class AccountAnalyticLine(models.Model): | ||
_inherit = "account.analytic.line" | ||
|
||
def _timesheet_preprocess(self, vals_list): | ||
res = super()._timesheet_preprocess(vals_list) | ||
@api.model_create_multi | ||
def create(self, vals_list): | ||
for vals in vals_list: | ||
if vals.get("task_id") and not vals.get("tag_ids"): | ||
task = self.env["project.task"].browse(vals.get("task_id")) | ||
vals["tag_ids"] = [Command.set(task.analytic_tag_ids.ids)] | ||
return res | ||
return super().create(vals_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
- [Tecnativa](https://www.tecnativa.com): | ||
- Víctor Martínez | ||
- Pedro M. Baeza | ||
- APSL - Nagarro \<<https://apsl.tech>\> | ||
- Bernat Obrador | ||
- [APSL-Nagarro](https://www.apsl.tech): | ||
- Bernat Obrador \<<bobrador@apsl.net>\> | ||
- Antoni Marroig \<<amarroig@apsl.net>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters