[FIX] mrp: add breadcrumbs on the subcontracting portal
task-3201527 Sub-task: 3 Part-of: odoo/odoo#127409
This commit is contained in:
@@ -36,6 +36,9 @@
|
||||
'web.assets_backend': [
|
||||
'mrp_subcontracting/static/src/components/**/*',
|
||||
],
|
||||
'web.assets_frontend': [
|
||||
'mrp_subcontracting/static/src/scss/subcontracting_portal.scss',
|
||||
],
|
||||
'mrp_subcontracting.webclient': [
|
||||
('include', 'web._assets_helpers'),
|
||||
('include', 'web._assets_backend_helpers'),
|
||||
|
||||
@@ -79,7 +79,8 @@ class CustomerPortal(portal.CustomerPortal):
|
||||
self._document_check_access('stock.picking', picking_id)
|
||||
except (AccessError, MissingError):
|
||||
raise werkzeug.exceptions.NotFound
|
||||
return request.render("mrp_subcontracting.subcontracting_portal", {'picking_id': picking_id})
|
||||
picking = request.env['stock.picking'].browse(picking_id)
|
||||
return request.render("mrp_subcontracting.subcontracting_portal", {'picking': picking})
|
||||
|
||||
@http.route("/my/productions/<int:picking_id>/subcontracting_portal", type="http", auth="user", methods=['GET'])
|
||||
def render_production_backend_view(self, picking_id):
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.o_subcontracting_portal {
|
||||
height: 90%;
|
||||
}
|
||||
@@ -18,9 +18,15 @@
|
||||
|
||||
<template id="portal_my_home_menu_production" name="Portal layout : production menu entries" inherit_id="portal.portal_breadcrumbs" priority="25">
|
||||
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
|
||||
<li t-if="page_name == 'production' or production" t-attf-class="breadcrumb-item #{'active' if not pickings else ''}">
|
||||
<t>Productions</t>
|
||||
</li>
|
||||
<t t-if="title">
|
||||
<li t-attf-class="breadcrumb-item #{'active' if breadcrumbs_url else ''}">
|
||||
<a t-if="breadcrumbs_url" t-attf-href="/my/productions{{ keep_query() }}">Productions</a>
|
||||
<t t-else="" t-esc="title"></t>
|
||||
</li>
|
||||
<li t-attf-class="breadcrumb-item">
|
||||
<a t-if="breadcrumbs_url"><t t-esc="title"/></a>
|
||||
</li>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@@ -61,13 +67,27 @@
|
||||
|
||||
<template id="subcontracting_portal" name="Subcontracting View in Portal">
|
||||
<t t-call="portal.frontend_layout">
|
||||
<t t-set="no_footer" t-value="true"/>
|
||||
<t t-call="mrp_subcontracting.subcontracting"/>
|
||||
<div class="o_portal container mt-3">
|
||||
<div class="row align-items-center bg-white g-0 border rounded">
|
||||
<div class="col-10">
|
||||
<t t-call="mrp_subcontracting.portal_my_home_menu_production">
|
||||
<t t-set="title" t-value="picking.name"/>
|
||||
<t t-set="breadcrumbs_url">/my/productions</t>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_portal container mt-3 o_subcontracting_portal">
|
||||
<div class="row align-items-center bg-white g-0 border rounded o_subcontracting_portal">
|
||||
<t t-set="no_footer" t-value="true"/>
|
||||
<t t-call="mrp_subcontracting.subcontracting"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="subcontracting" name="Subcontracting Portal View">
|
||||
<iframe width="100%" height="100%" frameborder="0" t-attf-src="/my/productions/{{ picking_id }}/subcontracting_portal"/>
|
||||
<iframe width="100%" height="100%" frameborder="0" t-attf-src="/my/productions/{{ picking.id }}/subcontracting_portal"/>
|
||||
</template>
|
||||
|
||||
<template id="subcontracting_portal_embed" name="Subcontracting Portal">
|
||||
|
||||
Reference in New Issue
Block a user