From 3e18b7e4d99858f15bfd391fd63c755a01999501 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Wed, 13 Jan 2016 15:17:01 +0100 Subject: [PATCH] Making the 'personal contact' informations depentens of the module 'personal_contact_information' --- .../__openerp__.py | 3 ++- .../models/res_partner.py | 10 ++++----- .../views/res_partner.xml | 21 +------------------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/partner_contact_in_several_companies/__openerp__.py b/partner_contact_in_several_companies/__openerp__.py index a668001fc..7dde7c792 100644 --- a/partner_contact_in_several_companies/__openerp__.py +++ b/partner_contact_in_several_companies/__openerp__.py @@ -23,7 +23,8 @@ 'installable': True, 'auto_install': False, "depends": [ - "base" + "base", + "partner_contact_personal_information_page", ], "data": [ "views/res_partner.xml", diff --git a/partner_contact_in_several_companies/models/res_partner.py b/partner_contact_in_several_companies/models/res_partner.py index 3338dc52a..580463498 100644 --- a/partner_contact_in_several_companies/models/res_partner.py +++ b/partner_contact_in_several_companies/models/res_partner.py @@ -36,8 +36,8 @@ class ResPartner(models.Model): Actually, is easier to override a dictionary value to indicate it should be ignored... """ - if mode != 'search' \ - and 'search_show_all_positions' in self.env.context: + if (mode != 'search' and + 'search_show_all_positions' in self.env.context): result = self.with_context( search_show_all_positions={'is_set': False}) else: @@ -48,9 +48,9 @@ class ResPartner(models.Model): def search(self, args, offset=0, limit=None, order=None, count=False): """ Display only standalone contact matching ``args`` or having attached contact matching ``args`` """ - if self.env.context.get('search_show_all_positions', {}).get('is_set') \ - and not self.env.context[ - 'search_show_all_positions']['set_value']: + ctx = self.env.context + if (ctx.get('search_show_all_positions', {}).get('is_set') and + not ctx['search_show_all_positions']['set_value']): args = expression.normalize_domain(args) attached_contact_args = expression.AND( (args, [('contact_type', '=', 'attached')]) diff --git a/partner_contact_in_several_companies/views/res_partner.xml b/partner_contact_in_several_companies/views/res_partner.xml index 2e4fcaab4..a56bb51b3 100644 --- a/partner_contact_in_several_companies/views/res_partner.xml +++ b/partner_contact_in_several_companies/views/res_partner.xml @@ -2,25 +2,6 @@ - - - Personal information page for contacts form - res.partner - - 2 - - - - - - - - - - - res.partner.select.contact res.partner @@ -162,7 +143,7 @@ Contacts in several partners: personal info res.partner - +