Initial commit of timesheet_description and timesheet_description_sale for 11.0 -- Forces popup for timesheet (detail) and allows you to display them as Markdown in the portal.

This commit is contained in:
Jared Kipe
2018-05-23 11:47:37 -07:00
parent 84fb41e43a
commit 0a21d042d1
9 changed files with 145 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
try:
from markdown import markdown
except ImportError:
markdown = None
from odoo import api, fields, models
class AnalyticLine(models.Model):
_inherit = 'account.analytic.line'
name_markdown = fields.Html(compute='_compute_name_markdown')
@api.multi
def _compute_name_markdown(self):
if not markdown:
for line in self:
# Why not just name? Because it needs to be escaped.
# Use nothing to indicate that it shouldn't be used.
line.name_markdown = ''
else:
for line in self:
line.name_markdown = markdown(line.name)