mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-19 00:02:03 +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,41 @@
|
|||
# Copyright 2017 - 2018 Modoolar <info@modoolar.com>
|
||||
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo import http
|
||||
|
||||
# from odoo.http import request
|
||||
|
||||
|
||||
class ProjectBrowser(http.Controller):
|
||||
def get_record_url(self, model, domain, action_xml_id):
|
||||
env = http.request.env()
|
||||
|
||||
records = env[model].search(domain)
|
||||
record_id = records and records.id or -1
|
||||
action_id = env.ref(action_xml_id).id
|
||||
|
||||
return "/web#id={}&view_type=form&model={}&action={}".format(
|
||||
record_id, model, action_id
|
||||
)
|
||||
|
||||
def get_task_url(self, key):
|
||||
return self.get_record_url(
|
||||
"project.task", [("key", "=ilike", key)], "project.action_view_task"
|
||||
)
|
||||
|
||||
def get_project_url(self, key):
|
||||
return self.get_record_url(
|
||||
"project.project",
|
||||
[("key", "=ilike", key)],
|
||||
"project.open_view_project_all_config",
|
||||
)
|
||||
|
||||
@http.route(["/projects/<string:key>"], type="http", auth="user")
|
||||
def open_project(self, key, **kwargs):
|
||||
return werkzeug.utils.redirect(self.get_project_url(key), 301)
|
||||
|
||||
@http.route(["/tasks/<string:key>"], type="http", auth="user")
|
||||
def open_task(self, key, **kwargs):
|
||||
return werkzeug.utils.redirect(self.get_task_url(key), 301)
|
||||
Loading…
Add table
Add a link
Reference in a new issue