changes
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user