mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-18 17:42:00 +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).
|
||||
|
||||
from . import project_task
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
# Copyright 2016 Tecnativa <vicent.cubells@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class ProjectTask(models.Model):
|
||||
_inherit = "project.task"
|
||||
_rec_names_search = ["name", "code"]
|
||||
|
||||
code = fields.Char(
|
||||
string="Task Number",
|
||||
required=True,
|
||||
default="/",
|
||||
readonly=True,
|
||||
copy=False,
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
"project_task_unique_code",
|
||||
"UNIQUE (company_id, code)",
|
||||
_("The code must be unique!"),
|
||||
),
|
||||
]
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if vals.get("code", "/") == "/":
|
||||
vals["code"] = (
|
||||
self.env["ir.sequence"].next_by_code("project.task") or "/"
|
||||
)
|
||||
return super().create(vals_list)
|
||||
|
||||
def name_get(self):
|
||||
result = super().name_get()
|
||||
new_result = []
|
||||
|
||||
for task in result:
|
||||
rec = self.browse(task[0])
|
||||
name = "[{}] {}".format(rec.code, task[1])
|
||||
new_result.append((rec.id, name))
|
||||
return new_result
|
||||
Loading…
Add table
Add a link
Reference in a new issue