Skip to content

Commit

Permalink
Fix OCA coding conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
dreispt committed Jan 25, 2017
1 parent 28ee6dd commit 8c50272
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 87 deletions.
12 changes: 8 additions & 4 deletions timesheet_task/README.rst
Expand Up @@ -56,9 +56,12 @@ You can disable it again once the migration work has been completed.
Usage
=====

To use this module, you need to:

#. Go to ...
In Project Tasks, you can create work lines.
They look similar to the original work lines, and allow to select the User u
and record a date and dtime for the work.
But in fact these liens are being directly stored as Timesheet lines.
You can confirm this by creating a Timesheet for the User covering the data of
the work line. The work resorded from the Project Task will also be availablein the Timesheet.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
Expand All @@ -70,7 +73,8 @@ To use this module, you need to:
Known issues / Roadmap
======================

* ...
None.


Bug Tracker
===========
Expand Down
21 changes: 2 additions & 19 deletions timesheet_task/__init__.py
@@ -1,23 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2013 Nicolas Bessi, Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import project_task
from . import project_task_work
from . import report
23 changes: 3 additions & 20 deletions timesheet_task/__openerp__.py
@@ -1,23 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# Copyright 2013 Nicolas Bessi, Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{'name': 'Analytic Timesheet In Task',
'version': '8.0.1.0.0',
'author': "Camptocamp, Daniel Reis, Odoo Community Association (OCA)",
Expand Down
1 change: 0 additions & 1 deletion timesheet_task/project_task.py
Expand Up @@ -2,7 +2,6 @@
# Copyright 2013 Nicolas Bessi, Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from openerp.osv import orm, fields
from openerp import api, SUPERUSER_ID
from openerp.tools.translate import _
Expand Down
1 change: 1 addition & 0 deletions timesheet_task/project_task_view.xml
Expand Up @@ -5,6 +5,7 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="type">form</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_ids']" position="replace">
<field colspan="4" name="work_ids" nolabel="1">
Expand Down
1 change: 0 additions & 1 deletion timesheet_task/project_task_work.py
Expand Up @@ -2,7 +2,6 @@
# Copyright 2017 Daniel Reis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


import logging
from openerp import api, models
from openerp.exceptions import except_orm
Expand Down
22 changes: 3 additions & 19 deletions timesheet_task/report/__init__.py
@@ -1,21 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Authors: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import hr_timesheet_report
29 changes: 6 additions & 23 deletions timesheet_task/report/hr_timesheet_report.py
@@ -1,40 +1,23 @@

# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Authors: Laurent Mignon
# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import fields, models


class hr_timesheet_report(models.Model):
class HRTimesheetReport(models.Model):
_inherit = "hr.timesheet.report"
_name = "hr.timesheet.report"

task_id = fields.Many2one('project.task', string='Task', readonly=True)

def _select(self):
select_str = super(hr_timesheet_report, self)._select()
select_str = super(HRTimesheetReport, self)._select()
select_str += ", aal.task_id as task_id"
return select_str

def _group_by(self):
group_by_str = super(hr_timesheet_report, self)._group_by()
group_by_str = super(HRTimesheetReport, self)._group_by()
group_by_str += ", aal.task_id"
return group_by_str

0 comments on commit 8c50272

Please sign in to comment.