Skip to content

Commit

Permalink
[LINT]
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero authored and sebastienbeau committed Jul 5, 2024
1 parent ad310c4 commit 391d7c1
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion project_workload/models/project_task_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def week_name(value):
return None


week_merge_re = re.compile((r"(\d{4})-(\d{2}) - (\1)-(\d{2})"))
week_merge_re = re.compile(r"(\d{4})-(\d{2}) - (\1)-(\d{2})")


class ProjectTaskWorkload(models.Model):
Expand Down
3 changes: 2 additions & 1 deletion project_workload_additions/models/project_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def _get_new_workloads(self):
return rv

def _get_updated_workloads(self):
# We sort the workloads by additional_workload_id to ensure that the first workload is the main one
# We sort the workloads by additional_workload_id to ensure that the
# first workload is the main one
self.workload_ids = self.workload_ids.sorted(
key=lambda w: w.additional_workload_id
)
Expand Down
3 changes: 2 additions & 1 deletion project_workload_additions/models/project_workload_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def name_get(self):
for unit_id, name in result:
unit = self.browse(unit_id)
if unit.workload_id.additional_workload_id:
name = f"{unit.workload_id.additional_workload_id.task_id.name} {_('of')} {name}"
name = f"{unit.workload_id.additional_workload_id.task_id.name} "
f"{_('of')} {name}"
units_names[unit_id] = name

return list(units_names.items())
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

<record id="project_task_workload_view_form" model="ir.ui.view">
<field name="model">project.task.workload</field>
<field name="inherit_id" ref="project_workload.project_task_workload_view_form" />
<field
name="inherit_id"
ref="project_workload.project_task_workload_view_form"
/>
<field name="arch" type="xml">
<field name="unit_ids" position="after">
<group>
Expand Down
1 change: 1 addition & 0 deletions project_workload_capacity/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
"views/project_load_capacity_report_view.xml",
"views/menu_view.xml",
],
"installable": False,
}
3 changes: 2 additions & 1 deletion project_workload_milestone/models/project_milestone.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ def _compute_milestone_start_date(self):
limit=1,
)
# The start date will be the end date of the previous milestone
record.start_date = previous_milestones.target_date + timedelta(days=1)
if previous_milestones.target_date:
record.start_date = previous_milestones.target_date + timedelta(days=1)
1 change: 1 addition & 0 deletions project_workload_milestone/views/project_milestone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<record id="project_milestone_view_form" model="ir.ui.view">
<field name="model">project.milestone</field>
<field name="inherit_id" ref="project_milestone.project_milestone_view_form" />
<field name="priority" eval="100" />
<field name="arch" type="xml">
<field name="project_id" position="replace" />
<field name="target_date" position="before">
Expand Down
4 changes: 1 addition & 3 deletions project_workload_timesheet/models/account_analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# @author Florian Mounier <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError

from odoo import api, fields, models

from odoo.addons.project_workload.models.project_task_workload import week_name

Expand Down
1 change: 0 additions & 1 deletion project_workload_timesheet/models/project_workload_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def action_timesheet_time(self):

def action_timesheet_done(self):
self.done = True
pass

def _get_timesheeting_task(self):
# For overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
widget="progressbar"
optional="show"
/>

<field
name="timesheeted_hours"
string="Timesheeted"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# @author Florian Mounier <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo import fields, models


class AccountAnalyticLine(models.Model):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2024 Akretion (https://www.akretion.com).
# @author Florian Mounier <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo import models


class Sheet(models.Model):
Expand Down
6 changes: 6 additions & 0 deletions setup/project_workload_timesheet_additions/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 391d7c1

Please sign in to comment.