[16.0][MIG] mgmtsystem_nonconformity_project: Migration to 16.0 - #748
[16.0][MIG] mgmtsystem_nonconformity_project: Migration to 16.0#748ChanGuaZzz wants to merge 34 commits into
Conversation
|
I can mark it for the migration, but I don't use this module. Anyway, please check the red CI. |
5f9c02f to
755b16c
Compare
|
@max3903 can you review please? |
…inked to projects
Currently translated at 100.0% (5 of 5 strings) Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity_project Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity_project/pt_BR/
Currently translated at 100.0% (5 of 5 strings) Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity_project Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity_project/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: management-system-12.0/management-system-12.0-mgmtsystem_nonconformity_project Translate-URL: https://translation.odoo-community.org/projects/management-system-12-0/management-system-12-0-mgmtsystem_nonconformity_project/
554d298 to
27d220f
Compare
marcos-mendez
left a comment
There was a problem hiding this comment.
Automated Review -- Tests Failed
1. Root Cause of the Test Failure
The test failure is caused by a database connection error during Odoo startup (Connection to the database failed). This is likely due to misconfiguration or an environment issue in the test runner, not directly related to the code changes in this PR.
2. Suggested Fix
No code fix is needed for the test failure itself, as it's an infrastructure issue. However, to ensure robustness, the module should be tested with proper database setup. The code changes in mgmtsystem_nonconformity_project/models/mgmtsystem_nonconformity_project.py are valid and follow OCA patterns.
3. Additional Code Issues
There are no real bugs in the code provided. The implementation correctly inherits from mgmtsystem.action, adds a new action_type selection field, and implements a computed field complete_name that respects the action type. The use of _compute_complete_name is appropriate and follows Odoo conventions.
4. Test Improvements
To improve test coverage for this module, consider adding the following test cases in a tests/test_mgmtsystem_nonconformity_project.py file using SavepointCase (as per OCA testing patterns):
from odoo.tests.common import SavepointCase
class TestMgmtsystemNonconformityProject(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Create a project
cls.project = cls.env['project.project'].create({
'name': 'Test Project',
})
# Create a nonconformity action
cls.action = cls.env['mgmtsystem.action'].create({
'name': 'Test Action',
'action_type': 'action',
})
def test_action_type_selection(self):
"""Test that action_type field works correctly."""
self.assertEqual(self.action.action_type, 'action')
def test_complete_name_action_type(self):
"""Test complete_name computation for action type."""
self.assertEqual(self.action.complete_name, 'Test Action')
def test_complete_name_project_type(self):
"""Test complete_name computation for project type."""
self.action.action_type = 'project'
self.action.project_id = self.project
self.assertEqual(self.action.complete_name, 'Test Project')This test ensures:
- The
action_typeselection works as expected - The
complete_namefield is computed correctly based on action type - The integration with
project.projectmodel works correctly
Use SavepointCase for tests involving data persistence and transactions, as recommended by OCA.
⏰ PR Aging Alert
This PR by @ChanGuaZzz has been open for 164 days (5 months).
Every ignored PR is a contributor who might not come back. Review time matters. (OCA Aging Report)
Reciprocal Review Request
Hi everyone! I found some test failures on this PR and left detailed feedback above. I am happy to discuss or help debug. In the meantime, if any of you get a chance, I would appreciate a look at my open PR(s):
My open PRs across OCA:
- server-tools#3554 [MIG] datetime_formatter: Migration to 18.0
- server-tools#3548 [18.0][MIG] base_kanban_stage: Migration to 18.0
- hr-attendance#262 [16.0][ADD] Hr_attendance_idsecure: iDSecure (ControliD) attendance integration
- stock-logistics-workflow#2276 [16.0][ADD] stock_move_line_devaluation
- stock-logistics-workflow#2275 [16.0][ADD] Stock move line analytic account
- stock-logistics-workflow#2268 [16.0][ADD] stock_move_line_picking_partner
- purchase-workflow#2694 [16.0][IMP]Purchase workflow added to review state & exception fix
Reviewing each other's work helps the whole community move forward. Thank you!
Environment via OCA Neural Reviewer: Minikube + K8s Job + oca-ci/py3.10-odoo16.0 | Odoo 16.0
Automated review by OCA Neural Reviewer + qwen3-coder:30b
27d220f to
3075e5c
Compare
marcos-mendez
left a comment
There was a problem hiding this comment.
Apologies for the noise from the automated review — the bot incorrectly used "changes requested" status, which revoked the approved label that @cubells had already granted. I'm fixing the bot to use "comment" status instead, so this won't happen again.
Module 'mgmtsystem_nonconformity_project' migration to 16.0.
@pedrobaeza can you review?