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.

24 lines
949 B

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