Richard deMeester
9 years ago
3 changed files with 34 additions and 29 deletions
-
2partner_contact_in_several_companies/models/__init__.py
-
23partner_contact_in_several_companies/models/ir_actions.py
-
38partner_contact_in_several_companies/models/res_partner.py
@ -1,4 +1,4 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import multi_contact |
|||
from . import res_partner, ir_actions |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from openerp import models, api |
|||
|
|||
|
|||
class IRActionsWindow(models.Model): |
|||
_inherit = 'ir.actions.act_window' |
|||
|
|||
@api.multi |
|||
def read(self, fields=None, context=None, load='_classic_read'): |
|||
actions = super(IRActionsWindow, self).read(fields=fields, load=load) |
|||
for action in actions: |
|||
if action.get('res_model', '') == 'res.partner': |
|||
# By default, only show standalone contact |
|||
action_context = action.get('context', '{}') or '{}' |
|||
if 'search_show_all_positions' not in action_context: |
|||
action['context'] = action_context.replace( |
|||
'{', |
|||
("{'search_show_all_positions': " |
|||
"{'is_set': True, 'set_value': False},"), |
|||
1) |
|||
return actions |
Write
Preview
Loading…
Cancel
Save
Reference in new issue