Project and Services mailing list archives

project@odoo-community.org

Avatar

Re: [OCA/project] project_task_scheduling: Module for automatic task planning (#419)

by Andrea Stirpe <notifications@github.com> - 25/09/2018 13:00:22

@astirpe requested changes on this pull request.

Here some more code review.

Are you working also on #419 (comment)? Shall we expect some extra developments, or this version is the final one?


In project_task_scheduling/models/project.py:

> @@ -0,0 +1,10 @@
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+from odoo import fields, models
+
+
+class Task(models.Model):
+    _inherit = 'project.task'
+
+    closed = fields.Boolean(

Could this field be moved to module project_stage_closed ?


In project_task_scheduling/views/project_task_scheduling_proposal_views.xml:

> +                        <field name="evaluation"/>
+                    </group>
+                    <notebook>
+                        <page string="Scheduling" name="scheduling">
+                            <group>
+                                <field name="task_scheduling_ids" nolabel="1">
+                                    <tree>
+                                        <field name="employee_id"/>
+                                        <field name="task_id"/>
+                                        <field name="datetime_start"/>
+                                        <field name="datetime_stop"/>
+                                        <field name="delayed"/>
+                                        <button name="action_set_assignation"
+                                                type="object"
+                                                string="Set assignation"
+                                                icon="fa-check"

Clicking on this button I would expect that the icon changes to something different, to notify that the assignation is applied. As it is right now, the user doen't know which task is already set for assignation and which not.


In project_task_scheduling/wizards/scheduling_wizard.py:

> +                data = {'pos_from': 0, 'pos_to': len_acum - 1, 'duration': dur}
+                inteval = calendar._interval_new(i_start[0], i_stop[1], data)
+                employees_dict[emp.id] = [inteval]
+
+        tasks = self._get_assigned_tasks()
+        for task in tasks:
+            gaps = employees_dict[task.employee_id.id]
+            start = fields.Datetime.from_string(task.date_start)
+            stop = fields.Datetime.from_string(task.date_end)
+            data = {'employee': task.employee_id}
+            to_remove = calendar._interval_new(start, stop, data)
+            self._gaps_remove_interval(gaps, to_remove)
+
+        return employees_dict
+
+    def _obj_func(self, state):

Could you rename this function to something more self-explanatory?


In project_task_scheduling/models/project_task_scheduling_proposal.py:

> +
+class ProjectTaskScheduling(models.TransientModel):
+    _name = 'project.task.scheduling.proposal'
+    _description = "Project task scheduling proposal"
+    _rec_name = "evaluation"
+    _order = 'evaluation'
+
+    description = fields.Char()
+    date_start = fields.Datetime()
+    date_end = fields.Datetime(
+        compute='_compute_end'
+    )
+    duration = fields.Float(
+        compute='_compute_end'
+    )
+    delayed_tasks = fields.Float(

Shouldn't this be an integer?


In project_task_scheduling/views/project_task_scheduling_proposal_views.xml:

> +                        <field name="evaluation"/>
+                    </group>
+                    <notebook>
+                        <page string="Scheduling" name="scheduling">
+                            <group>
+                                <field name="task_scheduling_ids" nolabel="1">
+                                    <tree>
+                                        <field name="employee_id"/>
+                                        <field name="task_id"/>
+                                        <field name="datetime_start"/>
+                                        <field name="datetime_stop"/>
+                                        <field name="delayed"/>
+                                        <button name="action_set_assignation"
+                                                type="object"
+                                                string="Set assignation"
+                                                icon="fa-check"

Same discourse for the global Set scheduling button.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.