Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] fieldservice_portal: Migration to 16.0 #1224

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

anusriNPS
Copy link

MIgrating fieldservice_portal to 16.0 version

@anusriNPS anusriNPS marked this pull request as draft October 15, 2024 15:20
@anusriNPS anusriNPS force-pushed the 16.0-mig-fieldservice_portal branch 2 times, most recently from 34469f2 to ff69dce Compare October 15, 2024 15:37
@max3903 max3903 added this to the 16.0 milestone Oct 16, 2024
@max3903 max3903 self-assigned this Oct 16, 2024
@max3903
Copy link
Member

max3903 commented Oct 16, 2024

/ocabot migration fieldservice_portal

@max3903 max3903 changed the title [16.0] [MIG] fieldservice portal: Migration to 16.0 [16.0][MIG] fieldservice_portal: Migration to 16.0 Oct 16, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 16, 2024
48 tasks
@anusriNPS anusriNPS marked this pull request as ready for review October 16, 2024 10:24
Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: minor fixes in the views

<em class="font-weight-normal text-muted">
Work Orders for
<t
t-esc="searchbar_groupby[groupby]['label']"

Choose a reason for hiding this comment

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

t-esc has been deprecated in 15.0 in favour of t-out

Copy link
Author

Choose a reason for hiding this comment

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

Done

<tr>
<td>
<a t-attf-href="/my/workorder/#{order.id}">
<t t-esc="order.name" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

</a>
</td>
<td>
<t t-esc="order.description" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

</td>
<td>
<t
t-esc="order.sudo().location_id.display_name"

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

/>
</td>
<td>
<t t-esc="order.type.name" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

<t t-esc="order.type.name" />
</td>
<td>
<t t-esc="order.stage_id.name" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

</div>
<div class="col-md-6">
<strong>Stage:</strong>
<t t-esc="order.stage_id.name" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

<t t-else="">Work Orders</t>
</li>
<li t-if="fsm_order" class="breadcrumb-item active">
<t t-esc="fsm_order.name" />

Choose a reason for hiding this comment

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

also here

Copy link
Author

Choose a reason for hiding this comment

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

Done

@anusriNPS
Copy link
Author

Verified views after using t-out instead of t-esc and all are intact

@PicchiSeba
Copy link

We might need to add some tests, the coverage is quite low.

@anusriNPS anusriNPS force-pushed the 16.0-mig-fieldservice_portal branch 6 times, most recently from 53a537d to 4926016 Compare October 24, 2024 14:24
@max3903
Copy link
Member

max3903 commented Oct 24, 2024

@anusriNPS I don't see Work Orders on the portal:
image

What did I miss? A configuration step that should be added to the readme fragments?

@anusriNPS
Copy link
Author

anusriNPS commented Oct 24, 2024

@max3903 Work orders are listed while using API /my/workorders, is this API you are looking for or is it required work order to be listed on homepage? Currently, as per available changes, on home page workorders are not displayed
image

@max3903
Copy link
Member

max3903 commented Oct 24, 2024

@anusriNPS My expectation is that the customer can create and track their FSM orders on the portal. So it should appear on the portal page.

This is my opinion. Others can share theirs...

@max3903
Copy link
Member

max3903 commented Oct 24, 2024

Maybe you can document that this is not available and provide the direct path in the readme fragments.

@brian10048
Copy link
Contributor

@anusriNPS My expectation is that the customer can create and track their FSM orders on the portal. So it should appear on the portal page.

This is my opinion. Others can share theirs...

My expectation is the same. As a customer, you would be able to view your FSM orders from the portal home page just like other documents

Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: following the maintainer suggestions we should add the necessary button to the main portal view

It can be accessed at /my with the portal user



class CustomerPortal(CustomerPortal):
def _prepare_portal_layout_values(self):

Choose a reason for hiding this comment

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

issue: missing from Controller

Suggested change
def _prepare_portal_layout_values(self):
def _prepare_home_portal_values(self, counters):
values = super()._prepare_home_portal_values(counters)
if "fsm_order_count" in counters:
fsm_order_model = request.env["fsm.order"]
fsm_order_count = (
fsm_order_model.search_count([])
if fsm_order_model.check_access_rights("read", raise_exception=False)
else 0
)
values["fsm_order_count"] = fsm_order_count
return values
def _prepare_portal_layout_values(self):

Copy link
Author

Choose a reason for hiding this comment

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

Done

Comment on lines 31 to 38
>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="fsm_order_count" t-call="portal.portal_docs_entry">
<t t-set="title">Work Orders</t>
<t t-set="url" t-value="'/my/workorders'" />
<t t-set="count" t-value="fsm_order_count" />
</t>

Choose a reason for hiding this comment

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

issue: missing from portal view

Suggested change
>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="fsm_order_count" t-call="portal.portal_docs_entry">
<t t-set="title">Work Orders</t>
<t t-set="url" t-value="'/my/workorders'" />
<t t-set="count" t-value="fsm_order_count" />
</t>
customize_show="True"
>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Work Orders</t>
<t t-set="url" t-value="'/my/workorders'" />
<t t-set="placeholder_count" t-value="'fsm_order_count'" />
</t>

Copy link
Author

Choose a reason for hiding this comment

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

Done

@anusriNPS anusriNPS force-pushed the 16.0-mig-fieldservice_portal branch 2 times, most recently from e202162 to 53b631b Compare October 25, 2024 13:53
@@ -0,0 +1,13 @@
/** @odoo-module */
Copy link

@PicchiSeba PicchiSeba Oct 25, 2024

Choose a reason for hiding this comment

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

issue: pre-commit is whining because the file must be renamed fsm_order_portal.esm.js

Copy link
Author

Choose a reason for hiding this comment

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

Updated extension with "esm.js". Thank you @PicchiSeba

Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: LGTM

Copy link

@peluko00 peluko00 left a comment

Choose a reason for hiding this comment

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

LGTM

@peluko00
Copy link

Seems i'ts ready to merge @max3903

@max3903
Copy link
Member

max3903 commented Oct 28, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-1224-by-max3903-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit df95c53 into OCA:16.0 Oct 28, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 3b96423. Thanks a lot for contributing to OCA. ❤️

@PicchiSeba PicchiSeba deleted the 16.0-mig-fieldservice_portal branch October 28, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants