MIG website_project_task For Odoo 13.0

This commit is contained in:
Bhoomi
2019-09-23 18:33:12 -04:00
parent 08a5e7f0c9
commit 3e6a7da53c
5 changed files with 36 additions and 4 deletions

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -1,6 +1,6 @@
{
'name': 'Website Project Tasks',
'version': '12.0.1.0.0',
'version': '13.0.1.0.0',
'author': 'Hibou Corp. <hello@hibou.io>',
'website': 'https://hibou.io/',
'license': 'AGPL-3',
@@ -17,7 +17,7 @@ This module adds options to Website Project:
'project',
],
'data': [
'project_task_templates.xml',
'views/project_task_templates.xml',
],
'installable': True,
'auto_install': False,

View File

@@ -0,0 +1 @@
from . import project

View File

@@ -0,0 +1,14 @@
from odoo import api, exceptions, fields, models, _
from werkzeug.urls import url_encode
class ProjectTask(models.Model):
_name = 'project.task'
_inherit = ['project.task', 'portal.mixin']
def preview_task(self):
self.ensure_one()
return {
'type': 'ir.actions.act_url',
'target': 'self',
'url': self.get_portal_url(),
}

View File

@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_task_form2_inherit" model="ir.ui.view">
<field name="name">project.task.form.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="preview_task" type="object" class="oe_stat_button" icon="fa-globe icon">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Task</span>
<span class="o_stat_text">Preview</span>
</div>
</button>
</xpath>
</field>
</record>
<template id="my_tasks" inherit_id='project.portal_my_tasks' name="Stage Colors etc.">
<xpath expr="//td/span[hasclass('badge-info')]" position="attributes">
@@ -9,10 +25,10 @@
<template id="task_tag_grid" inherit_id='project.portal_my_tasks' customize_show="True" name="Task Tags on table">
<xpath expr="//thead/tr/th[1]" position="attributes">
<xpath expr="//t/t/t/t/thead/tr/th[1]" position="attributes">
<attribute name="class">col-md-8</attribute>
</xpath>
<xpath expr="//thead/tr/th[2]" position="after">
<xpath expr="//t/t/t/t/thead/tr/th[2]" position="after">
<th>Tags</th>
</xpath>
<!-- Strange number of columns -->