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.

23 lines
922 B

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