mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-20 19:42:08 +02:00
Move 124 sale modules to oca-sale, create oca-project with 56 project modules from oca-workflow-process
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9eb7ae5807
commit
6094c218b2
2332 changed files with 125826 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright 2022 Tecnativa - Víctor Martínez
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountAnalyticLine(models.Model):
|
||||
_inherit = "account.analytic.line"
|
||||
|
||||
stock_task_id = fields.Many2one(
|
||||
comodel_name="project.task", string="Project Task", ondelete="cascade"
|
||||
)
|
||||
|
||||
def _timesheet_postprocess_values(self, values):
|
||||
"""When hr_timesheet addon is installed, in the create() and write() methods,
|
||||
the amount is recalculated according to the employee cost.
|
||||
We need to force that in the records related to stock tasks the price is not
|
||||
updated."""
|
||||
res = super()._timesheet_postprocess_values(values)
|
||||
for key in self.filtered(lambda x: x.stock_task_id).ids:
|
||||
res[key].pop("amount", None)
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue