Skip to content

[19.0][MIG] helpdesk_mgmt_fieldservice_equipment: Migration to 19.0#1017

Open
Tomero-Dev wants to merge 8 commits into
OCA:19.0from
Tomero-Dev:19.0-mig-helpdesk_mgmt_fieldservice_equipment
Open

[19.0][MIG] helpdesk_mgmt_fieldservice_equipment: Migration to 19.0#1017
Tomero-Dev wants to merge 8 commits into
OCA:19.0from
Tomero-Dev:19.0-mig-helpdesk_mgmt_fieldservice_equipment

Conversation

@Tomero-Dev

Copy link
Copy Markdown

No description provided.

@OCA-git-bot OCA-git-bot added series:19.0 mod:helpdesk_mgmt_fieldservice_equipment Module helpdesk_mgmt_fieldservice_equipment labels May 27, 2026
@Tomero-Dev Tomero-Dev force-pushed the 19.0-mig-helpdesk_mgmt_fieldservice_equipment branch 5 times, most recently from febf3b3 to 12587e7 Compare May 27, 2026 15:20
"license": "AGPL-3",
"category": "HelpDesk Service",
"depends": ["fieldservice", "helpdesk_mgmt_fieldservice"],
"depends": ["base", "fieldservice", "helpdesk_mgmt_fieldservice"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tomero-Dev Could you explain why you added base to the depends ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the changes as you requested.

Thank you for the feedback. 😉

@Tomero-Dev Tomero-Dev force-pushed the 19.0-mig-helpdesk_mgmt_fieldservice_equipment branch from 12587e7 to d08144f Compare May 29, 2026 07:35

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class TestFSMEquipment(TransactionCase):
class TestFSMEquipment(Basecommon):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +12 to +15
cls.location_partner_id = (
cls.env["res.partner"].create({"name": "Loc Partner 1"}).id
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class TestHelpdeskTicketEquipment(TransactionCase):
class TestHelpdeskTicketEquipment(Basecommon):

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cls.partner = cls.env["res.partner"].create({"name": "Partner 1"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:helpdesk_mgmt_fieldservice_equipment Module helpdesk_mgmt_fieldservice_equipment series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants