From fa764a5ce74f1aea3ad9185270b5d07928fa39ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Dec 2012 18:56:34 +0100 Subject: [PATCH] [REM] Analytic_contract: removed bridge module between contract and crm that was not adding something valuable. bzr revid: tde@openerp.com-20121218175634-ii8mbwa89xsbzay2 --- addons/analytic_contract_crm/__init__.py | 24 -------- addons/analytic_contract_crm/__openerp__.py | 41 -------------- .../analytic_contract_crm.py | 56 ------------------- 3 files changed, 121 deletions(-) delete mode 100644 addons/analytic_contract_crm/__init__.py delete mode 100644 addons/analytic_contract_crm/__openerp__.py delete mode 100644 addons/analytic_contract_crm/analytic_contract_crm.py diff --git a/addons/analytic_contract_crm/__init__.py b/addons/analytic_contract_crm/__init__.py deleted file mode 100644 index d9f03c8c56c..00000000000 --- a/addons/analytic_contract_crm/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import analytic_contract_crm - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_contract_crm/__openerp__.py b/addons/analytic_contract_crm/__openerp__.py deleted file mode 100644 index 096c22c7d9b..00000000000 --- a/addons/analytic_contract_crm/__openerp__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'CRM: Contract link', - 'version': '1.1', - 'category': 'Hidden', - 'description': """ -This module is for set subtype of sales team in contract. -====================================================================================================== -""", - 'author': 'OpenERP S.A.', - 'website': 'http://www.openerp.com/', - 'depends': ['account_analytic_analysis','crm'], - 'data': [], - 'demo': [], - 'css' : [], - 'installable': True, - 'auto_install': True, -} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_contract_crm/analytic_contract_crm.py b/addons/analytic_contract_crm/analytic_contract_crm.py deleted file mode 100644 index 8dfdca08d41..00000000000 --- a/addons/analytic_contract_crm/analytic_contract_crm.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from osv import osv, fields -from tools.translate import _ - -class account_analytic_account(osv.osv): - _inherit = "account.analytic.account" - - def create(self, cr, uid, vals, context=None): - obj_id = super(account_analytic_account, self).create(cr, uid, vals, context=context) - manager_id = self.browse(cr, uid, obj_id, context=context).manager_id - if manager_id: - if manager_id.default_section_id: - # subscribe salesteam followers & subtypes to the contract - self._subscribe_followers_subtype(cr, uid, [obj_id], manager_id.default_section_id, 'crm.case.section', context=context) - if obj_id: - self.create_send_note(cr, uid, [obj_id], context=context) - return obj_id - - def write(self, cr, uid, ids, vals, context=None): - if isinstance(ids, (int, long)): - ids = [ids] - if vals.get('manager_id'): - section_id = self.pool.get('res.users').browse(cr, uid, vals.get('manager_id'), context=context).default_section_id - if section_id: - vals.setdefault('message_follower_ids', []) - vals['message_follower_ids'] += [(6, 0,[follower.id]) for follower in section_id.message_follower_ids] - res = super(account_analytic_account, self).write(cr, uid, ids, vals, context=context) - # subscribe new salesteam followers & subtypes to the contract - if vals.get('manager_id'): - if section_id: - self._subscribe_followers_subtype(cr, uid, ids, section_id, 'crm.case.section', context=context) - return res - -account_analytic_account() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: