[ADD] create project_funders
to track funds on tasks
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
This commit is contained in:
committed by
Stéphan Sainléger
parent
d4f7f9626d
commit
677999bf9f
13
project_funders/models/project_task.py
Normal file
13
project_funders/models/project_task.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class ProjectTask(models.Model):
|
||||
_inherit = "project.task"
|
||||
|
||||
funder_ids = fields.One2many("project.funder", "task_id", string="funder")
|
||||
amount_total = fields.Float(compute="_compute_amount_total", string="Amount Total")
|
||||
|
||||
@api.depends("funder_ids")
|
||||
def _compute_amount_total(self):
|
||||
for record in self:
|
||||
record.amount_total = sum(record.funder_ids.mapped("amount"))
|
Reference in New Issue
Block a user