[FIX] website: make "Edit in backend" always go to website backend
Before this commit, clicking "Edit in backend" from the website could randomly lead to the backend under another menu or without module, depending on the other modules that are installed or version com/ent used. After this commit, it will always open the backend under the specifiec menu or website menu if not defined. + uses existing website dedicated action for product.template in 'Edit backend' task-1919436 closes #30555 Co-authored by seb@odoo.com closes odoo/odoo#30657
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a role="menuitem" style="text-align: left;" t-attf-href="/web#return_label=Website&view_type=form&model=#{main_object._name}&id=#{main_object.id}&action=#{action}"
|
||||
<a role="menuitem" style="text-align: left;" t-attf-href="/web#return_label=Website&view_type=form&model=#{main_object._name}&id=#{main_object.id}&action=#{action}&menu_id=#{menu or main_object.env.ref('website.menu_website_configuration').id}"
|
||||
class="dropdown-item" title='Edit in backend' id="edit-in-backend">Edit in backend</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<button type="button" t-attf-class="btn btn-default dropdown-toggle dropdown-toggle-split" t-att-id="'dopprod-%s' % object.id" data-toggle="dropdown"/>
|
||||
<div class="dropdown-menu" role="menu" t-att-aria-labelledby="'dopprod-%s' % object.id">
|
||||
<t t-raw="0"/>
|
||||
<a role="menuitem" t-attf-href="/web#return_label=Website&view_type=form&model=#{object._name}&id=#{object.id}&action=#{action}"
|
||||
<a role="menuitem" t-attf-href="/web#return_label=Website&view_type=form&model=#{object._name}&id=#{object.id}&action=#{action}&menu_id=#{menu or object.env.ref('website.menu_website_configuration').id}"
|
||||
title='Edit in backend' class="dropdown-item" t-if="publish_edit">Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -413,9 +413,10 @@
|
||||
<!-- /shop/product product page -->
|
||||
<template id="product_edit_options" inherit_id="website.user_navbar" name="Edit Product Options">
|
||||
<xpath expr="//li[@id='edit-page-menu']" position="after">
|
||||
<t t-if="main_object._name == 'product.template'" t-set="action" t-value="'product.product_template_action'" />
|
||||
<t t-if="main_object._name == 'product.template'" t-set="action" t-value="'website_sale.product_template_action_website'" />
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="product" name="Product">
|
||||
|
||||
<t t-set="first_possible_combination" t-value="product._get_first_possible_combination()"/>
|
||||
|
||||
Reference in New Issue
Block a user