This commit is contained in:
gsinghpal
2026-05-01 00:20:40 -04:00
parent bdcbd86db2
commit 1da27ed6bf
8 changed files with 117 additions and 12 deletions

View File

@@ -546,15 +546,23 @@ export class RecipeTreeEditor extends Component {
// ---- Navigation ---------------------------------------------------------
onBackToList() {
// If the editor was opened from the part-scoped Process Composer
// (context carried part_id), return to that part's form instead
// of the generic Recipes list.
// Pop this editor off the action stack and restore the
// previous controller — which is whatever opened the editor:
// * Recipes list → recipe form → editor ⇒ back to recipe form
// * Part form → composer → editor ⇒ back to composer
// * Part form → editor (direct link) ⇒ back to part form
//
// clearBreadcrumbs: this is a semantic RETURN, not a forward
// navigation. Without it, every round-trip (part → composer →
// editor → back) leaves its intermediate pages on the breadcrumb
// stack, so a second visit shows "…/Process Composer/Process
// Editor/Process Composer/Process Editor/Part" nonsense.
// restore() preserves the full breadcrumb trail.
// clearBreadcrumbs: true (the old behaviour) would wipe parent
// crumbs and isolate the user on a single-crumb page.
try {
this.action.restore();
return;
} catch (e) {
// No prior controller — fall through to a sensible default.
}
// Fallback: when opened directly via URL with no prior crumb,
// pick the most contextual landing page we have.
if (this._partId) {
this.action.doAction({
type: "ir.actions.act_window",

View File

@@ -196,6 +196,17 @@ export class FpSimpleRecipeEditor extends Component {
* breadcrumb stack so a second visit shows nonsense.
*/
onBackToList() {
// Pop this editor off the action stack and restore the
// previous controller — preserves the full breadcrumb trail
// (Recipes > LGPS1104 > Editor → back keeps "Recipes"
// visible; Part > Composer > Editor → back returns to the
// Composer with crumbs intact).
try {
this.action.restore();
return;
} catch (e) {
// No prior controller — fall through to a sensible default.
}
if (this._partId) {
this.action.doAction(
{