diff --git a/project_enhanced/models/project.py b/project_enhanced/models/project.py index e5ffda2b..c9b49097 100644 --- a/project_enhanced/models/project.py +++ b/project_enhanced/models/project.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import fields, models, api +from odoo import fields, models class Project(models.Model): diff --git a/project_enhanced/models/project_task.py b/project_enhanced/models/project_task.py index efcf9cd8..d2b316b9 100644 --- a/project_enhanced/models/project_task.py +++ b/project_enhanced/models/project_task.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import fields, models, api +from odoo import fields, models class ProjectTask(models.Model): diff --git a/project_iteration/tests/test_followers_propagation.py b/project_iteration/tests/test_followers_propagation.py index d094e85e..2fbbc451 100644 --- a/project_iteration/tests/test_followers_propagation.py +++ b/project_iteration/tests/test_followers_propagation.py @@ -1,7 +1,6 @@ # © 2022 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -import pytest from .common import ProjectIterationCase diff --git a/project_iteration_parent_only/__init__.py b/project_iteration_parent_only/__init__.py index a83e39a7..ae201b3e 100644 --- a/project_iteration_parent_only/__init__.py +++ b/project_iteration_parent_only/__init__.py @@ -1,3 +1,2 @@ # © 2023 - Today Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - diff --git a/project_material/models/project_task_material.py b/project_material/models/project_task_material.py index 6eb7d784..ae759856 100644 --- a/project_material/models/project_task_material.py +++ b/project_material/models/project_task_material.py @@ -238,8 +238,8 @@ def _check_quantity_can_be_reduced(self): if more_to_reduce_than_available: raise ValidationError( _( - "The quantity on the material line {line} can not be reduced to {new_quantity} " - "(it can not be lower than the delivered quantity).\n\n" + "The quantity on the material line {line} can not be reduced to " + "{new_quantity} (it can not be lower than the delivered quantity).\n\n" "The line may not be reduced below a minimum of {minimum_qty} {uom}." ).format( line=self.product_id.display_name, @@ -288,12 +288,12 @@ def _get_total_move_qty(self): ) def _get_first_step_moves(self): - moves = self.env["stock.move"] + _moves = self.env["stock.move"] - for moves in self._iter_procurement_moves(): + for _moves in self._iter_procurement_moves(): pass - return moves + return _moves def _cancel_moves_with_zero_quantity(self): """Cancel the stock moves related to this line with zero quantity. diff --git a/project_material/models/stock_warehouse.py b/project_material/models/stock_warehouse.py index 54b38ada..4b97ba03 100644 --- a/project_material/models/stock_warehouse.py +++ b/project_material/models/stock_warehouse.py @@ -1,7 +1,7 @@ # Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, fields, models, SUPERUSER_ID, _ +from odoo import api, fields, models, _ ONE_STEP_KEY = "one_step" diff --git a/project_milestone_enhanced/models/project_milestone.py b/project_milestone_enhanced/models/project_milestone.py index fff93a39..e766ee2b 100644 --- a/project_milestone_enhanced/models/project_milestone.py +++ b/project_milestone_enhanced/models/project_milestone.py @@ -1,7 +1,7 @@ # © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, models, fields +from odoo import models, fields class ProjectMilestone(models.Model): diff --git a/project_milestone_enhanced/tests/test_project.py b/project_milestone_enhanced/tests/test_project.py index 984f5a46..9b6e39b2 100644 --- a/project_milestone_enhanced/tests/test_project.py +++ b/project_milestone_enhanced/tests/test_project.py @@ -41,7 +41,7 @@ def test_copy_project(self): project = self.project.copy({}) tasks = project.with_context(active_test=False).task_ids milestone = project.milestone_ids.filtered( - lambda milestone: not "2" in milestone.name + lambda milestone: "2" not in milestone.name ) assert tasks[0].milestone_id == milestone and tasks[1].milestone_id == milestone diff --git a/project_milestone_time_report/tests/test_project_milestone_time_report.py b/project_milestone_time_report/tests/test_project_milestone_time_report.py index 2dc7e093..95ebb677 100644 --- a/project_milestone_time_report/tests/test_project_milestone_time_report.py +++ b/project_milestone_time_report/tests/test_project_milestone_time_report.py @@ -32,36 +32,36 @@ def setUpClass(cls): "project_id": cls.lot.id, }) cls.task_a = cls.env["project.task"].create({ - "name": "Task A", - "project_id": cls.lot.id, - "milestone_id": cls.milestone_a.id, - "planned_hours": 4, - "stage_id": cls.folded_stage.id, + "name": "Task A", + "project_id": cls.lot.id, + "milestone_id": cls.milestone_a.id, + "planned_hours": 4, + "stage_id": cls.folded_stage.id, }) cls.task_b = cls.env["project.task"].create({ - "name": "Task B", - "project_id": cls.lot.id, - "milestone_id": cls.milestone_b.id, - "planned_hours": 8, - "stage_id": cls.folded_stage.id, - }) + "name": "Task B", + "project_id": cls.lot.id, + "milestone_id": cls.milestone_b.id, + "planned_hours": 8, + "stage_id": cls.folded_stage.id, + }) # Add timelines to created tasks cls.timesheet_a = cls.env["account.analytic.line"].create({ - "name": "Analyse", - "project_id": cls.lot.id, - "task_id": cls.task_a.id, - "unit_amount": 3, - "employee_id": 1, - "date": "2022-06-25", - }) + "name": "Analyse", + "project_id": cls.lot.id, + "task_id": cls.task_a.id, + "unit_amount": 3, + "employee_id": 1, + "date": "2022-06-25", + }) cls.timesheet_b = cls.env["account.analytic.line"].create({ - "name": "Conception", - "project_id": cls.lot.id, - "task_id": cls.task_b.id, - "unit_amount": 4, - "employee_id": 1, - "date": "2022-06-30", - }) + "name": "Conception", + "project_id": cls.lot.id, + "task_id": cls.task_b.id, + "unit_amount": 4, + "employee_id": 1, + "date": "2022-06-30", + }) cls.report = cls.env["project.milestone.time.report"] def test_amounts(self): diff --git a/project_outsourcing/models/project_task.py b/project_outsourcing/models/project_task.py index e62def57..24918959 100644 --- a/project_outsourcing/models/project_task.py +++ b/project_outsourcing/models/project_task.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, fields, models, _ +from odoo import fields, models, _ from odoo.exceptions import ValidationError diff --git a/project_outsourcing/models/purchase_order_line.py b/project_outsourcing/models/purchase_order_line.py index 278043f5..83006686 100644 --- a/project_outsourcing/models/purchase_order_line.py +++ b/project_outsourcing/models/purchase_order_line.py @@ -20,7 +20,6 @@ def _prepare_account_move_line(self, move=False): result["task_id"] = self.order_id.task_id.id return result - @api.constrains("is_outsourcing", "product_id") def _check_if_is_outsourcing__product_is_service(self): outsourcing_lines = self.filtered(lambda l: l.is_outsourcing) diff --git a/project_outsourcing/tests/test_project_task.py b/project_outsourcing/tests/test_project_task.py index e1a562a0..6b3f126c 100644 --- a/project_outsourcing/tests/test_project_task.py +++ b/project_outsourcing/tests/test_project_task.py @@ -13,7 +13,7 @@ def setUpClass(cls): def test_outsourcing_line_ids(self): self.task.outsourcing_line_ids.refresh() assert self.task.outsourcing_line_ids == ( - self.order.order_line | self.order_2.order_line + self.order.order_line | self.order_2.order_line ) def test_outsourcing_po_count(self): diff --git a/project_outsourcing_timesheet_automation/models/project_task.py b/project_outsourcing_timesheet_automation/models/project_task.py index f6cc05a3..23aa4d4a 100644 --- a/project_outsourcing_timesheet_automation/models/project_task.py +++ b/project_outsourcing_timesheet_automation/models/project_task.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import models, api, fields, _ +from odoo import models, fields, _ from datetime import datetime @@ -24,11 +24,11 @@ class ProjectTask(models.Model): def _check_outsourcing_pol(self): existing_pol = self.timesheet_ids.mapped('purchase_order_line_id') outsourcing_pol = self.outsourcing_line_ids.filtered( - lambda pol: pol.order_id.is_outsourcing and - pol.state in ['purchase', 'done'] and - pol.partner_id.subcontracting_auto_time_entries and - pol.product_id.automate_time_entries and - pol.id not in existing_pol.ids + lambda pol: pol.order_id.is_outsourcing + and pol.state in ['purchase', 'done'] + and pol.partner_id.subcontracting_auto_time_entries + and pol.product_id.automate_time_entries + and pol.id not in existing_pol.ids ) if outsourcing_pol: return outsourcing_pol @@ -74,11 +74,7 @@ def write(self, vals): for record in self: if 'stage_id' in vals and self.env['project.task.type'].browse( vals['stage_id']).create_subcontractors_time_entries: - print('====================stage name', self.env['project.task.type'].browse( - vals['stage_id']).name) outsourcing_pol = record._check_outsourcing_pol() - print('====================outsourcing_pol', - outsourcing_pol) if outsourcing_pol: record._create_timesheet_line(outsourcing_pol) return res diff --git a/project_outsourcing_timesheet_automation/models/purchase_order.py b/project_outsourcing_timesheet_automation/models/purchase_order.py index cf905949..b03eb817 100644 --- a/project_outsourcing_timesheet_automation/models/purchase_order.py +++ b/project_outsourcing_timesheet_automation/models/purchase_order.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import models, api +from odoo import models class PurchaseOrder(models.Model): diff --git a/project_outsourcing_timesheet_automation/tests/__init__.py b/project_outsourcing_timesheet_automation/tests/__init__.py index ccb86b73..0ca2c599 100644 --- a/project_outsourcing_timesheet_automation/tests/__init__.py +++ b/project_outsourcing_timesheet_automation/tests/__init__.py @@ -1,4 +1,2 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - - diff --git a/project_outsourcing_timesheet_automation/tests/test_project_task.py b/project_outsourcing_timesheet_automation/tests/test_project_task.py index 31a11111..2ab1f5f1 100644 --- a/project_outsourcing_timesheet_automation/tests/test_project_task.py +++ b/project_outsourcing_timesheet_automation/tests/test_project_task.py @@ -8,7 +8,6 @@ class TestProjectTask(OutsourcingCase): def setUp(self): super(TestProjectTask, self).setUp() - def test_create_timesheet_line_automatically(self): self.task.outsourcing_line_ids.refresh() self.task.write({"stage_id": self.stage_test.id}) diff --git a/project_stage/models/project_stage.py b/project_stage/models/project_stage.py index c4b36b5c..ce42341a 100644 --- a/project_stage/models/project_stage.py +++ b/project_stage/models/project_stage.py @@ -15,7 +15,8 @@ class ProjectStage(models.Model): active = fields.Boolean(default=True) fold = fields.Boolean( string='Folded in Kanban', - help='This stage is folded in the kanban view when there are no records in that stage to display.' + help="""This stage is folded in the kanban view when there are + no records in that stage to display.""" ) @@ -23,8 +24,10 @@ class ProjectWithStage(models.Model): _inherit = 'project.project' def compute_default_stage(self): - return self.env['project.stage'].search([('fold', '=', False)], order='sequence', limit=1).id + return self.env['project.stage'].search( + [('fold', '=', False)], order='sequence', limit=1).id stage_id = fields.Many2one( - 'project.stage', 'Stage', ondelete='restrict', index=True, default=compute_default_stage, + 'project.stage', 'Stage', ondelete='restrict', index=True, + default=compute_default_stage, tracking=True) diff --git a/project_stage_allow_timesheet/models/account_analytic_line.py b/project_stage_allow_timesheet/models/account_analytic_line.py index dd2859fa..f20e9e9d 100644 --- a/project_stage_allow_timesheet/models/account_analytic_line.py +++ b/project_stage_allow_timesheet/models/account_analytic_line.py @@ -15,8 +15,8 @@ def _check_task_project_allow_timesheet(self): return error_message = _( - "You can't link a time sheet line to a task if its project's stage does not allow it. " - "(Task: {}, Project: {}, Project Stage: {})" + "You can't link a time sheet line to a task if its project's stage" + " does not allow it. (Task: {}, Project: {}, Project Stage: {})" ) for rec in self: task = rec.task_id @@ -34,13 +34,14 @@ class ProjectTask(models.Model): @api.constrains("project_id") def _check_project_move_allow_timesheet(self): - """ Check if a line is moved to another project, the target project must allow time sheet """ + """ Check if a line is moved to another project, + the target project must allow time sheet """ if not _should_apply_constraints(self.env): return error_message = _( - "You cannot move a task linked to a timesheet line in a project if its stage does not allow it. " - "(Task: {}, Project: {}, Project Stage: {})" + "You cannot move a task linked to a timesheet line in a project if its stage" + " does not allow it. (Task: {}, Project: {}, Project Stage: {})" ) for rec in self: diff --git a/project_stage_allow_timesheet/models/project_stage.py b/project_stage_allow_timesheet/models/project_stage.py index 002f19f1..6021199b 100644 --- a/project_stage_allow_timesheet/models/project_stage.py +++ b/project_stage_allow_timesheet/models/project_stage.py @@ -13,7 +13,6 @@ class ProjectStage(models.Model): ) - class ProjectTaskType(models.Model): _inherit = 'project.task.type' @@ -22,4 +21,3 @@ class ProjectTaskType(models.Model): string="Allow timesheets", default=True, ) - diff --git a/project_task_analytic_lines/models/account_analytic_line.py b/project_task_analytic_lines/models/account_analytic_line.py index 14e74655..e066b23c 100644 --- a/project_task_analytic_lines/models/account_analytic_line.py +++ b/project_task_analytic_lines/models/account_analytic_line.py @@ -23,9 +23,8 @@ def _onchange_analytic_account_empty_task(self): def _check_origin_task_and_project_match(self): for line in self: task_not_matching_project = ( - line.origin_task_id - and line.origin_task_id.project_id.analytic_account_id - != line.account_id + line.origin_task_id + and line.origin_task_id.project_id.analytic_account_id != line.account_id ) if task_not_matching_project: raise ValidationError( diff --git a/project_task_analytic_lines/models/account_move.py b/project_task_analytic_lines/models/account_move.py index ef6634e3..97cd1094 100644 --- a/project_task_analytic_lines/models/account_move.py +++ b/project_task_analytic_lines/models/account_move.py @@ -1,8 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, models, _ -from odoo.exceptions import ValidationError +from odoo import models class AccountMove(models.Model): diff --git a/project_task_analytic_lines/models/account_move_line.py b/project_task_analytic_lines/models/account_move_line.py index c17c7597..fbc6bd52 100644 --- a/project_task_analytic_lines/models/account_move_line.py +++ b/project_task_analytic_lines/models/account_move_line.py @@ -27,8 +27,8 @@ def _prepare_analytic_line(self): def _check_task_matches_with_project(self): task_not_matching_project = ( - self.task_id - and self.task_id.project_id.analytic_account_id != self.analytic_account_id + self.task_id + and self.task_id.project_id.analytic_account_id != self.analytic_account_id ) if task_not_matching_project: raise ValidationError( diff --git a/project_task_analytic_lines/models/project_task.py b/project_task_analytic_lines/models/project_task.py index 0d70e7c0..bfe89eb4 100644 --- a/project_task_analytic_lines/models/project_task.py +++ b/project_task_analytic_lines/models/project_task.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, models, _ +from odoo import models, _ from odoo.exceptions import ValidationError diff --git a/project_task_analytic_lines/tests/common.py b/project_task_analytic_lines/tests/common.py index 7b256ff9..f4142ed7 100644 --- a/project_task_analytic_lines/tests/common.py +++ b/project_task_analytic_lines/tests/common.py @@ -54,6 +54,7 @@ def setUpClass(cls): limit=1, ) + class InvoiceCase(AccountCase): @classmethod def setUpClass(cls): @@ -78,16 +79,16 @@ def setUpClass(cls): "name": "10% tax", "amount_type": "percent", "amount": 0.10, - #"account_id": cls.tax_account.id, + # "account_id": cls.tax_account.id, } ) cls.invoice = cls.env["account.move"].create( { "partner_id": cls.partner.id, - #"project_id": cls.project.id, + # "project_id": cls.project.id, "move_type": "in_invoice", - #"account_id": cls.payable_account.id, + # "account_id": cls.payable_account.id, "invoice_line_ids": [(0, 0, cls._get_invoice_line_vals())], } ) @@ -97,7 +98,7 @@ def _get_invoice_line_vals(cls, **kwargs): defaults = { "name": "/", "quantity": 1, - #"uom_id": cls.env.ref("uom.product_uom_unit").id, + # "uom_id": cls.env.ref("uom.product_uom_unit").id, "price_unit": 100, "analytic_account_id": cls.analytic_account.id, "task_id": cls.task.id, diff --git a/project_task_full_text_search/models/project_task.py b/project_task_full_text_search/models/project_task.py index a5901407..d1dcbfaa 100644 --- a/project_task_full_text_search/models/project_task.py +++ b/project_task_full_text_search/models/project_task.py @@ -58,11 +58,14 @@ def _find_tasks_from_full_text_content(self, searched_text): self.env.cr.execute( """ SELECT id FROM project_task - WHERE to_tsvector(%(lang)s, full_text_content) @@ plainto_tsquery(%(lang)s, %(words)s); - """, { - 'lang': lang, - 'words': ' & '.join(words_to_search), - }) + WHERE to_tsvector(%(lang)s, full_text_content) @@ plainto_tsquery( + %(lang)s, %(words)s); + """, + { + "lang": lang, + "words": " & ".join(words_to_search), + }, + ) return [r[0] for r in self.env.cr.fetchall()] @@ -90,7 +93,9 @@ def _setup_content_index(self): use for the the gin index. """ _logger.info('Droping the full text search index on project_task if it exists.') - query = "DROP INDEX IF EXISTS {index_name}".format(index_name=FULL_TEXT_SEARCH_INDEX_NAME) + query = "DROP INDEX IF EXISTS {index_name}".format( + index_name=FULL_TEXT_SEARCH_INDEX_NAME + ) self.env.cr.execute(query) lang = self._get_full_text_content_language() diff --git a/project_task_id_in_display_name/controllers/portal.py b/project_task_id_in_display_name/controllers/portal.py index 40a8c7d5..15f1bdf9 100644 --- a/project_task_id_in_display_name/controllers/portal.py +++ b/project_task_id_in_display_name/controllers/portal.py @@ -13,13 +13,15 @@ class ProjectPortalWithSearchTaskByID(CustomerPortal): If the task with the given id is found, the user is redirected to the task form. """ - @http.route(['/my/tasks', '/my/tasks/page/'], type='http', auth="user", website=True) + @http.route(['/my/tasks', '/my/tasks/page/'], + type='http', auth="user", website=True) def portal_my_tasks(self, search=None, **kw): is_searching_by_task_id = isinstance(search, str) and search.strip().isdigit() if is_searching_by_task_id: task_id = search.strip() - task = http.request.env['project.task'].search([('id_string', '=', task_id)], limit=1) + task = http.request.env['project.task'].search( + [('id_string', '=', task_id)], limit=1) if task: query = urllib.parse.urlencode(dict(kw)) redirect_url = '/my/task/{task_id}?{query}'.format(task_id=task.id, query=query) diff --git a/project_task_milestone_mandatory/__manifest__.py b/project_task_milestone_mandatory/__manifest__.py index 101f56b4..2c78ad62 100644 --- a/project_task_milestone_mandatory/__manifest__.py +++ b/project_task_milestone_mandatory/__manifest__.py @@ -9,7 +9,8 @@ "website": "https://bit.ly/numigi-com", "license": "LGPL-3", "category": "Project", - "summary": "In task form view, field milestone is required if field Use milestones is True in project else invisible", + "summary": """In task form view, field milestone is required if field + Use milestones is True in project else invisible""", "depends": ["project_milestone_enhanced"], 'data': [ 'views/project_task.xml', diff --git a/project_task_reference/models/project_task.py b/project_task_reference/models/project_task.py index 7f72f13d..2628b327 100644 --- a/project_task_reference/models/project_task.py +++ b/project_task_reference/models/project_task.py @@ -12,15 +12,15 @@ def _get_task_ref_regex(env: 'Environment') -> str: return ( - env['ir.config_parameter'].sudo().get_param('project_task_reference.regex') or - DEFAULT_TASK_REF_REGEX + env["ir.config_parameter"].sudo().get_param("project_task_reference.regex") + or DEFAULT_TASK_REF_REGEX ) def _get_task_ref_normalized_format(env: 'Environment') -> str: return ( - env['ir.config_parameter'].sudo().get_param('project_task_reference.format') or - DEFAULT_TASK_REF_FORMAT + env["ir.config_parameter"].sudo().get_param("project_task_reference.format") + or DEFAULT_TASK_REF_FORMAT ) diff --git a/project_task_reference/tests/test_project_task.py b/project_task_reference/tests/test_project_task.py index 396be7ac..a2f093bc 100644 --- a/project_task_reference/tests/test_project_task.py +++ b/project_task_reference/tests/test_project_task.py @@ -66,10 +66,11 @@ def test_search_references_from_text(self): def test_if_task_id_wongly_named__raise_missing_error(self): regex_with_typo = r"TA#(?P\d+)" # task_id instead of id - self.env['ir.config_parameter'].set_param('project_task_reference.regex', regex_with_typo) - + self.env['ir.config_parameter'].set_param( + 'project_task_reference.regex', regex_with_typo) format_with_typo = "TA#{task_id}" - self.env['ir.config_parameter'].set_param('project_task_reference.format', format_with_typo) + self.env['ir.config_parameter'].set_param( + 'project_task_reference.format', format_with_typo) text = "TA#{} Some text".format(self.task_1.id) diff --git a/project_task_resource_type/__init__.py b/project_task_resource_type/__init__.py index 48a864bd..fd8d2296 100644 --- a/project_task_resource_type/__init__.py +++ b/project_task_resource_type/__init__.py @@ -1,4 +1,4 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from . import models \ No newline at end of file +from . import models diff --git a/project_task_resource_type/__manifest__.py b/project_task_resource_type/__manifest__.py index 2777a8a3..be4ccd99 100644 --- a/project_task_resource_type/__manifest__.py +++ b/project_task_resource_type/__manifest__.py @@ -10,7 +10,7 @@ "author": "Numigi", "maintainer": "Numigi", "website": "www.numigi.com", - "depends": ["project",], + "depends": ["project"], "data": [ "security/ir.model.access.csv", "views/project_resource_views.xml", diff --git a/project_task_resource_type/models/__init__.py b/project_task_resource_type/models/__init__.py index 43f22fe3..38d7a5c7 100644 --- a/project_task_resource_type/models/__init__.py +++ b/project_task_resource_type/models/__init__.py @@ -2,4 +2,4 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from . import project_resource -from . import project_task \ No newline at end of file +from . import project_task diff --git a/project_task_stage_external_mail/models/project_task.py b/project_task_stage_external_mail/models/project_task.py index da1be8a4..decbb2a2 100644 --- a/project_task_stage_external_mail/models/project_task.py +++ b/project_task_stage_external_mail/models/project_task.py @@ -1,7 +1,7 @@ # © 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). import logging -from odoo import models, api, fields +from odoo import models, fields _logger = logging.getLogger(__name__) @@ -19,5 +19,6 @@ def _track_template(self, changes): res = super(ProjectTask, self)._track_template(changes) test_task = self[0] if 'stage_id' in res and test_task.stage_id.external_mail: - res['stage_id'][-1]['subtype_id'] = self.env['ir.model.data'].xmlid_to_res_id('mail.mt_comment') + res['stage_id'][-1]['subtype_id'] = self.env['ir.model.data'].xmlid_to_res_id( + 'mail.mt_comment') return res diff --git a/project_task_stage_external_mail/tests/test_project_task.py b/project_task_stage_external_mail/tests/test_project_task.py index ff7b7bdc..7be5c553 100644 --- a/project_task_stage_external_mail/tests/test_project_task.py +++ b/project_task_stage_external_mail/tests/test_project_task.py @@ -12,7 +12,8 @@ def setUpClass(cls): cls.user_demo = cls.env.ref('base.user_demo') cls.discussion_type = cls.env.ref('mail.mt_comment') cls.internal_note_type = cls.env.ref('mail.mt_note') - cls.template = cls.env.ref('project_task_stage_external_mail.demo_mail_template_task_open') + cls.template = cls.env.ref( + 'project_task_stage_external_mail.demo_mail_template_task_open') cls.project = cls.env['project.project'].create({ 'name': 'Project 1', }) @@ -53,8 +54,9 @@ def setUpClass(cls): }) def _get_sent_message(self, task): - messages = task.message_ids.filtered(lambda m: 'Task Open: ' in (m.subject or '')).sorted(key=lambda s: s.id, - reverse=True) + messages = task.message_ids.filtered( + lambda m: 'Task Open: ' in (m.subject or '')).sorted( + key=lambda s: s.id, reverse=True) return messages def _get_message_recipients(self, task): diff --git a/project_task_subtask_same_project/models/project_task.py b/project_task_subtask_same_project/models/project_task.py index 5935ff16..e09cfc2e 100644 --- a/project_task_subtask_same_project/models/project_task.py +++ b/project_task_subtask_same_project/models/project_task.py @@ -24,7 +24,8 @@ def _check_subtask_not_in_different_project(self): )) def write(self, vals): - """ Propagate the value of the project to the subtask when it is changed on the parent task.""" + """ Propagate the value of the project to the subtask when it + is changed on the parent task.""" res = super().write(vals) for task in self: if task.child_ids and 'project_id' in vals: diff --git a/project_time_budget/models/project_project.py b/project_time_budget/models/project_project.py index daf669e9..ccb60b69 100644 --- a/project_time_budget/models/project_project.py +++ b/project_time_budget/models/project_project.py @@ -42,5 +42,5 @@ def _get_parent_template_tasks(self): def _compute_budget_remaining_hours(self): for project in self: project.budget_remaining_hours = ( - project.budget_planned_hours - project.consumed_hours + project.budget_planned_hours - project.consumed_hours ) diff --git a/project_time_budget/models/project_task.py b/project_time_budget/models/project_task.py index aae7abed..8264f3d4 100644 --- a/project_time_budget/models/project_task.py +++ b/project_time_budget/models/project_task.py @@ -37,7 +37,7 @@ def write(self, vals): restored_tasks = self.filtered(lambda t: not t.active) changing_estimates = ( - "min_hours" in vals or "planned_hours" in vals or "max_hours" in vals + "min_hours" in vals or "planned_hours" in vals or "max_hours" in vals ) res = super(ProjectTask, self).write(vals) diff --git a/project_time_budget/tests/test_project.py b/project_time_budget/tests/test_project.py index 906c7e1f..be8d509a 100644 --- a/project_time_budget/tests/test_project.py +++ b/project_time_budget/tests/test_project.py @@ -2,7 +2,6 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo.tests import common -from odoo.exceptions import ValidationError class TestProject(common.SavepointCase): diff --git a/project_time_range/models/project_project.py b/project_time_range/models/project_project.py index dcce0ad4..2d9b51a0 100644 --- a/project_time_range/models/project_project.py +++ b/project_time_range/models/project_project.py @@ -1,8 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import fields, models, api, _ -from odoo.exceptions import ValidationError +from odoo import fields, models, api class ProjectProject(models.Model): diff --git a/project_time_range/tests/test_project_project.py b/project_time_range/tests/test_project_project.py index 47d5fff4..cc67c097 100644 --- a/project_time_range/tests/test_project_project.py +++ b/project_time_range/tests/test_project_project.py @@ -2,7 +2,6 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo.tests import common -from odoo.exceptions import ValidationError class TestProject(common.SavepointCase): diff --git a/project_timesheet_analytic_update/models/project_project.py b/project_timesheet_analytic_update/models/project_project.py index 3c56e6dd..21c64a70 100644 --- a/project_timesheet_analytic_update/models/project_project.py +++ b/project_timesheet_analytic_update/models/project_project.py @@ -27,9 +27,9 @@ def _onchange_account_id(self): "title": _("Warning!"), "message": _( "Please note, you have modified the analytic account. \n" - "When saving, the project timelines will be updated with the new analytic " - "account < %s >." + "When saving, the project timelines will be updated with " + "the new analytic account < %s >." ) - % self.analytic_account_id.name, + % self.analytic_account_id.name, } } diff --git a/project_timesheet_analytic_update/tests/__init__.py b/project_timesheet_analytic_update/tests/__init__.py index 82d9bb4c..0ca2c599 100644 --- a/project_timesheet_analytic_update/tests/__init__.py +++ b/project_timesheet_analytic_update/tests/__init__.py @@ -1,3 +1,2 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). - diff --git a/project_wip/models/account_analytic_line.py b/project_wip/models/account_analytic_line.py index fce6b082..abbc5c71 100644 --- a/project_wip/models/account_analytic_line.py +++ b/project_wip/models/account_analytic_line.py @@ -1,7 +1,7 @@ # © 2020 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import fields, models, _ +from odoo import models, _ class AccountAnalyticLine(models.Model): diff --git a/project_wip/models/account_move_line.py b/project_wip/models/account_move_line.py index ab13218e..ef0279d3 100644 --- a/project_wip/models/account_move_line.py +++ b/project_wip/models/account_move_line.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, models +from odoo import models class AccountMoveLine(models.Model): diff --git a/project_wip/models/project_project.py b/project_wip/models/project_project.py index 273a691d..8dfc0f9d 100644 --- a/project_wip/models/project_project.py +++ b/project_wip/models/project_project.py @@ -1,7 +1,7 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import api, models, _ +from odoo import models, _ from odoo.exceptions import ValidationError, AccessError @@ -39,8 +39,8 @@ def check_wip_to_cgs_access(self): if not self.env.user.has_group("project_wip.group_wip_to_cgs"): raise AccessError( _( - "Only members of the group 'Transfert WIP to CGS' are allowed to transfer WIP " - "entries to CGS." + "Only members of the group 'Transfert WIP to CGS' are allowed " + "to transfer WIP entries to CGS." ) ) @@ -181,8 +181,8 @@ def _reconcile_wip_move_lines(self, wip_line, wip_reversal_line): if wip_line.matching_number == "P": raise ValidationError( _( - "The WIP entry {wip_line} ({amount}) could not be reconciled when transfering " - "the amount into Costs of Goods Sold. " + "The WIP entry {wip_line} ({amount}) could not be reconciled " + "when transfering the amount into Costs of Goods Sold. " "You should verify if the WIP entry is partially reconciled." ).format(wip_line=wip_line.display_name, amount=wip_line.balance) ) diff --git a/project_wip/models/project_type.py b/project_wip/models/project_type.py index 5a524382..5d2272eb 100644 --- a/project_wip/models/project_type.py +++ b/project_wip/models/project_type.py @@ -2,7 +2,7 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import api, fields, models, _ -from odoo.exceptions import ValidationError, AccessError +from odoo.exceptions import ValidationError class ProjectType(models.Model): diff --git a/project_wip/tests/test_wip_to_cgs.py b/project_wip/tests/test_wip_to_cgs.py index ee61a884..7d3fb6b4 100644 --- a/project_wip/tests/test_wip_to_cgs.py +++ b/project_wip/tests/test_wip_to_cgs.py @@ -4,7 +4,6 @@ import pytest from freezegun import freeze_time from datetime import datetime, date, timedelta -from odoo import fields from odoo.tests import common from odoo.exceptions import ValidationError, AccessError diff --git a/project_wip_material/models/stock_move.py b/project_wip_material/models/stock_move.py index 1d34b3f8..45ca728d 100644 --- a/project_wip_material/models/stock_move.py +++ b/project_wip_material/models/stock_move.py @@ -27,7 +27,7 @@ def _account_entry_move(self, qty, description, svl_id, cost): else: super()._account_entry_move(qty, description, svl_id, cost) - def _prepare_account_move_line(self, qty, cost, credit_account_id, + def _prepare_account_move_line(self, qty, cost, credit_account_id, debit_account_id, description): """Add the analytic to WIP account move lines.""" move_line_vals = super()._prepare_account_move_line( diff --git a/stock_location_production/__init__.py b/stock_location_production/__init__.py index 5073bf69..0ab5e8ea 100644 --- a/stock_location_production/__init__.py +++ b/stock_location_production/__init__.py @@ -1,3 +1,2 @@ # © 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -