You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
890 B

  1. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  2. from odoo import api, models
  3. class IRActionsWindow(models.Model):
  4. _inherit = 'ir.actions.act_window'
  5. @api.multi
  6. def read(self, fields=None, context=None, load='_classic_read'):
  7. actions = super(IRActionsWindow, self).read(fields=fields, load=load)
  8. for action in actions:
  9. if action.get('res_model', '') == 'res.partner':
  10. # By default, only show standalone contact
  11. action_context = action.get('context', '{}')
  12. if 'search_show_all_positions' not in action_context:
  13. action['context'] = action_context.replace(
  14. '{',
  15. ("{'search_show_all_positions': "
  16. "{'is_set': True, 'set_value': False},"),
  17. 1)
  18. return actions