This question has been flagged
4 Replies
10778 Views

Hello everybody.

I was browsing into stock module and I found that, when we open a product info in form view and then whe go to Reporting>Inventory valuation, the breadcrumb has still the link to the product, I think that may confuse.

The point is, how to clear the breadcrumb and show only "Inventory valuation"? 
I've tried setting clear_breadcrumbs or clear_breadcrumb field to True and setting target field to main in my custom module but nope.

I'm trying with this:

<record id="action_stock_inventory_valuation" model="ir.actions.act_window">
<field name="inherit_id" ref="stock_account.action_stock_inventory_valuation"></field>
<field name="res_model">stock.quantity.history</field>
<field name="name">Valuation Report</field>
<field name="clear_breadcrumbs">True</field>
</record>
Avatar
Discard
Best Answer

Hi,
You have to add 'no_breadcrumbs' : True in the action context.
For example

<field name="context"> {'no_breadcrumbs': True}</field>

Regards

Avatar
Discard
Best Answer
Try this:

def custom_main_button_action(self): ...(my stuff)... return { 'type': 'ir.actions.act_window', 'name': _('My_Name)'), 'res_model': 'my_model', 'view_type': 'form', 'view_mode': 'tree, form', 'target': 'current',
          'clear_breadcrumb': True, 'views': [(tree_id.id, 'tree'), (form_id.id, 'form')], }
Avatar
Discard
Best Answer

Use target:main


def custom_main_button_action(self):
  ...(my stuff)...
  return {
          'type': 'ir.actions.act_window',
          'name': _('My_Name)'),
          'res_model': 'my_model',
          'view_type': 'form',
          'view_mode': 'tree, form',
          'target': 'main',

'views': [(tree_id.id, 'tree'), (form_id.id, 'form')], }
Avatar
Discard