[NEW] pad_hedgedoc_tasks: create addon
This commit is contained in:
4
pad_hedgedoc_tasks/models/__init__.py
Normal file
4
pad_hedgedoc_tasks/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import project_task
|
||||
from . import hedgedoc_pad
|
10
pad_hedgedoc_tasks/models/hedgedoc_pad.py
Normal file
10
pad_hedgedoc_tasks/models/hedgedoc_pad.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, _
|
||||
|
||||
|
||||
class TaskHedgedocPad(models.Model):
|
||||
_name = "task.hedgedoc.pad"
|
||||
_inherit = "hedgedoc.pad"
|
||||
|
||||
task_id = fields.Many2one("project.task", string=_("Associated task"), copy=True)
|
19
pad_hedgedoc_tasks/models/project_task.py
Normal file
19
pad_hedgedoc_tasks/models/project_task.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class Task(models.Model):
|
||||
_inherit = "project.task"
|
||||
|
||||
task_hedgedoc_pads = fields.One2many("task.hedgedoc.pad", "task_id")
|
||||
|
||||
def create_hedgedoc_pad(self):
|
||||
return {
|
||||
"name": "Create a Hedgedoc pad",
|
||||
"type": "ir.actions.act_window",
|
||||
"view_mode": "form",
|
||||
"res_model": "create.hedgedoc.pad.wizard",
|
||||
"target": "new",
|
||||
"context": {'default_task_id': self.id},
|
||||
}
|
Reference in New Issue
Block a user