mirror of
https://github.com/bringout/oca-workflow-process.git
synced 2026-04-18 22:12:06 +02:00
Initial commit: OCA Workflow Process packages (456 packages)
This commit is contained in:
commit
d366e42934
18799 changed files with 1284507 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
from . import project
|
||||
from . import project_status
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
from odoo import SUPERUSER_ID, api, fields, models
|
||||
|
||||
|
||||
class Project(models.Model):
|
||||
_inherit = "project.project"
|
||||
|
||||
@api.model
|
||||
def _read_group_status_ids(self, statuses, domain, order):
|
||||
statuse_ids = statuses._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||
return statuses.browse(statuse_ids)
|
||||
|
||||
project_status = fields.Many2one(
|
||||
comodel_name="project.status",
|
||||
group_expand="_read_group_status_ids",
|
||||
copy=False,
|
||||
ondelete="restrict",
|
||||
index=True,
|
||||
)
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ProjectStatus(models.Model):
|
||||
_name = "project.status"
|
||||
_order = "status_sequence"
|
||||
_description = "Project Status"
|
||||
|
||||
name = fields.Char(
|
||||
required=True,
|
||||
translate=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name="res.company",
|
||||
string="Company",
|
||||
default=lambda self: self.env.company,
|
||||
)
|
||||
description = fields.Char(translate=True)
|
||||
status_sequence = fields.Integer(string="Sequence")
|
||||
is_closed = fields.Boolean(
|
||||
string="Is Closed Status",
|
||||
help="Specify if this is a closing status.",
|
||||
)
|
||||
fold = fields.Boolean(string="Folded")
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
seq = self.env["ir.sequence"].next_by_code("project.status") or 0
|
||||
vals["status_sequence"] = seq
|
||||
return super(ProjectStatus, self).create(vals)
|
||||
Loading…
Add table
Add a link
Reference in a new issue