WIP timesheet_description For Odoo 13.0 (Time sheet has new view on fronted)

This commit is contained in:
Bhoomi
2019-10-07 18:49:51 -04:00
parent c281267f54
commit 9d4fcba383
4 changed files with 45 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
{
'name': 'Timesheet Description',
'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',
@@ -16,7 +16,7 @@ Optionally, allows you to display your timesheet entries in markdown on the fron
'hr_timesheet',
],
'data': [
'views/project_templates.xml',
# 'views/project_templates.xml',
'views/timesheet_views.xml',
],
'installable': True,

View File

@@ -11,7 +11,6 @@ class AnalyticLine(models.Model):
name_markdown = fields.Html(compute='_compute_name_markdown')
@api.multi
def _compute_name_markdown(self):
if not markdown:
for line in self:

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="portal_my_task_markdown" inherit_id='project.portal_my_task' customize_show="True" name="Timesheet Use Markdown">
<template id="portal_my_task_markdown" inherit_id='hr_timesheet.portal_timesheet_table' name="Timesheet Use Markdown">
<xpath expr="//t[@t-esc='timesheet.name']" position="replace">
<div t-if="timesheet.name_markdown" t-field="timesheet.name_markdown" />
<t t-else="" t-esc="timesheet.name" />

View File

@@ -1,46 +1,46 @@
<?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="hr_timesheet.view_task_form2_inherited" />
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']" position="attributes">
<attribute name="context">{'default_project_id': project_id, 'default_task_id': active_id}</attribute>
</xpath>
<xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
<attribute name="editable"/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']" position="inside">
<form>
<sheet>
<group>
<group>
<field name="project_id" invisible="1"/>
<field name="task_id" invisible="1"/>
<field name="user_id" invisible="1" groups="hr_timesheet.group_timesheet_manager"/>
<field name="employee_id" groups="hr_timesheet.group_timesheet_manager"/>
</group>
<group>
<field name="date"/>
<field name="unit_amount" string="Time Spent" widget="float_time"/>
</group>
</group>
<field name="name" nolabel="1" widget="text" placeholder="Describe your activity (you can use markdown)" colspan="4"/>
</sheet>
</form>
</xpath>
</field>
</record>
<!-- <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="hr_timesheet.view_task_form2_inherited" />-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//field[@name='timesheet_ids']" position="attributes">-->
<!-- <attribute name="context">{'default_project_id': project_id, 'default_task_id': active_id}</attribute>-->
<!-- </xpath>-->
<!-- <xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">-->
<!-- <attribute name="editable"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//field[@name='timesheet_ids']" position="inside">-->
<!-- <form>-->
<!-- <sheet>-->
<!-- <group>-->
<!-- <group>-->
<!-- <field name="project_id" invisible="1"/>-->
<!-- <field name="task_id" invisible="1"/>-->
<!-- <field name="user_id" invisible="1" groups="hr_timesheet.group_timesheet_manager"/>-->
<!-- <field name="employee_id" groups="hr_timesheet.group_timesheet_manager"/>-->
<!-- </group>-->
<!-- <group>-->
<!-- <field name="date"/>-->
<!-- <field name="unit_amount" string="Time Spent" widget="float_time"/>-->
<!-- </group>-->
<!-- </group>-->
<!-- <field name="name" nolabel="1" widget="text" placeholder="Describe your activity (you can use markdown)" colspan="4"/>-->
<!-- </sheet>-->
<!-- </form>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
<record id="hr_timesheet_line_tree_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.tree.hr_timesheet.inherit</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="editable"/>
</xpath>
</field>
</record>
<!-- <record id="hr_timesheet_line_tree_inherit" model="ir.ui.view">-->
<!-- <field name="name">account.analytic.line.tree.hr_timesheet.inherit</field>-->
<!-- <field name="model">account.analytic.line</field>-->
<!-- <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//tree" position="attributes">-->
<!-- <attribute name="editable"/>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
</odoo>