mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-18 13: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,3 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
|
||||
|
||||
from . import project
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
# Copyright 2012 - 2013 Daniel Reis
|
||||
# Copyright 2015 - Antiun Ingeniería S.L. - Sergio Teruel
|
||||
# Copyright 2016 - Tecnativa - Vicent Cubells
|
||||
# Copyright 2018 - Brain-tec AG - Carlos Jesus Cebrian
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class Task(models.Model):
|
||||
"""Added Material Used in the Project Task."""
|
||||
|
||||
_inherit = "project.task"
|
||||
|
||||
material_ids = fields.One2many(
|
||||
comodel_name="project.task.material",
|
||||
inverse_name="task_id",
|
||||
string="Material Used",
|
||||
)
|
||||
|
||||
|
||||
class ProjectTaskMaterial(models.Model):
|
||||
"""Added Product and Quantity in the Task Material Used."""
|
||||
|
||||
_name = "project.task.material"
|
||||
_description = "Task Material Used"
|
||||
|
||||
task_id = fields.Many2one(
|
||||
comodel_name="project.task", string="Task", ondelete="cascade", required=True
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
comodel_name="product.product", string="Product", required=True
|
||||
)
|
||||
quantity = fields.Float()
|
||||
|
||||
@api.constrains("quantity")
|
||||
def _check_quantity(self):
|
||||
for material in self:
|
||||
if not material.quantity > 0.0:
|
||||
raise ValidationError(
|
||||
_("Quantity of material consumed must be greater than 0.")
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue