[19.0][MIG] helpdesk_mgmt_fieldservice_equipment: Migration to 19.0#1017
[19.0][MIG] helpdesk_mgmt_fieldservice_equipment: Migration to 19.0#1017Tomero-Dev wants to merge 8 commits into
Conversation
Currently translated at 100.0% (7 of 7 strings) Translation: helpdesk-18.0/helpdesk-18.0-helpdesk_mgmt_fieldservice_equipment Translate-URL: https://translation.odoo-community.org/projects/helpdesk-18-0/helpdesk-18-0-helpdesk_mgmt_fieldservice_equipment/it/
febf3b3 to
12587e7
Compare
| "license": "AGPL-3", | ||
| "category": "HelpDesk Service", | ||
| "depends": ["fieldservice", "helpdesk_mgmt_fieldservice"], | ||
| "depends": ["base", "fieldservice", "helpdesk_mgmt_fieldservice"], |
There was a problem hiding this comment.
@Tomero-Dev Could you explain why you added base to the depends ?
There was a problem hiding this comment.
Thanks for the note.
I added it when I got an initial error using the External ID of base.user_demo in the tests.
When I read about the changes in Odoo 19 regarding tests and that these references are no longer allowed, I changed everything, generating the test data in setUpClass.
That line remained there.
If you think it's necessary, I can remove it, although ultimately, base is always installed, but it's up to you.
Any advice is welcome.
There was a problem hiding this comment.
If there’s no specific logic requiring it, then I think we can remove it. Since base is already installed by default, keeping it in depends does not seem necessary in this case.
There was a problem hiding this comment.
I've made the changes as you requested.
Thank you for the feedback. 😉
12587e7 to
d08144f
Compare
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
Consider using BaseCommon instead of TransactionCase. In this case, there’s no need to redefine cls.env with tracking_disable=True, and res.partner is already available via BaseCommon. This would help simplify and optimize the test code.
| from odoo.tests.common import TransactionCase | ||
|
|
||
|
|
||
| class TestFSMEquipment(TransactionCase): |
There was a problem hiding this comment.
| class TestFSMEquipment(TransactionCase): | |
| class TestFSMEquipment(Basecommon): |
There was a problem hiding this comment.
Okay, those tests come directly from version 18, so I haven't modified practically anything, only the essentials.
I'll implement the changes you suggested.
Thanks.
| cls.location_partner_id = ( | ||
| cls.env["res.partner"].create({"name": "Loc Partner 1"}).id | ||
| ) | ||
|
|
There was a problem hiding this comment.
| cls.location_partner_id = ( | |
| cls.env["res.partner"].create({"name": "Loc Partner 1"}).id | |
| ) |
| from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT | ||
|
|
||
|
|
||
| class TestHelpdeskTicketEquipment(TransactionCase): |
There was a problem hiding this comment.
| class TestHelpdeskTicketEquipment(TransactionCase): | |
| class TestHelpdeskTicketEquipment(Basecommon): |
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) |
There was a problem hiding this comment.
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) |
| super().setUpClass() | ||
| cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) | ||
| # Create test data | ||
| cls.partner = cls.env["res.partner"].create({"name": "Partner 1"}) |
There was a problem hiding this comment.
| cls.partner = cls.env["res.partner"].create({"name": "Partner 1"}) |
No description provided.