-
Notifications
You must be signed in to change notification settings - Fork 239
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
[16.0][MIG] fieldservice_portal: Migration to 16.0 #1224
Conversation
34469f2
to
ff69dce
Compare
/ocabot migration fieldservice_portal |
There was a problem hiding this 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']" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ff69dce
to
a3405a4
Compare
Verified views after using t-out instead of t-esc and all are intact |
We might need to add some tests, the coverage is quite low. |
a3405a4
to
9c29318
Compare
53a537d
to
4926016
Compare
@anusriNPS I don't see Work Orders on the portal: What did I miss? A configuration step that should be added to the readme fragments? |
@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 |
@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... |
Maybe you can document that this is not available and provide the direct path in the readme fragments. |
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 |
There was a problem hiding this 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: missing from Controller
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
> | ||
<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> |
There was a problem hiding this comment.
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
> | |
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
e202162
to
53b631b
Compare
@@ -0,0 +1,13 @@ | |||
/** @odoo-module */ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
53b631b
to
df8b7ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review: LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Seems i'ts ready to merge @max3903 |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 3b96423. Thanks a lot for contributing to OCA. ❤️ |
MIgrating fieldservice_portal to 16.0 version