diff --git a/partner_contact_in_several_companies/__manifest__.py b/partner_contact_in_several_companies/__manifest__.py index b24028bd2..1a544f1c7 100644 --- a/partner_contact_in_several_companies/__manifest__.py +++ b/partner_contact_in_several_companies/__manifest__.py @@ -29,7 +29,6 @@ ], "data": [ "views/res_partner.xml", - "data/ir_actions.xml", ], "demo": [ "demo/res_partner.xml", diff --git a/partner_contact_in_several_companies/data/ir_actions.xml b/partner_contact_in_several_companies/data/ir_actions.xml deleted file mode 100644 index 2128d7d59..000000000 --- a/partner_contact_in_several_companies/data/ir_actions.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/partner_contact_in_several_companies/models/ir_actions.py b/partner_contact_in_several_companies/models/ir_actions.py index 599dd1e22..5352bc815 100644 --- a/partner_contact_in_several_companies/models/ir_actions.py +++ b/partner_contact_in_several_companies/models/ir_actions.py @@ -21,16 +21,3 @@ class IRActionsWindow(models.Model): "{'is_set': True, 'set_value': False},"), 1) return actions - - @api.model - def _enable_context(self): - action = self.env.ref('base.action_partner_form') - if 'search_show_all_positions' not in action.context: - - action_ctx = action.context.replace( - '{', - ("{'search_show_all_positions': " - "{'is_set': True, 'set_value': False},"), - 1) - action.write({'context': action_ctx}) - return True diff --git a/partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py b/partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py index b727638ce..5d9050e05 100644 --- a/partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py +++ b/partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +import logging from odoo.tests import common +_logger = logging.getLogger(__name__) class PartnerContactInSeveralCompaniesCase(common.TransactionCase): @@ -199,18 +201,24 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase): new_context_val = "'search_show_all_positions': " \ "{'is_set': True, 'set_value': False}" - details = self.env.ref('base.action_partner_form') + details = self.env['ir.actions.act_window'].for_xml_id( + 'base', + 'action_partner_form') + _logger.debug(details['context']) + self.assertIn( new_context_val, - details.context, + details['context'], msg='Default actions not updated with new context' ) - details = self.env.ref( - 'partner_contact_in_several_companies.action_partner_form') + details = self.env['ir.actions.act_window'].for_xml_id( + 'partner_contact_in_several_companies', + 'action_partner_form') + _logger.debug(details['context']) self.assertNotIn( new_context_val, - details.context, + details['context'], msg='Custom actions incorrectly updated with new context' )