1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
21 from osv import osv, fields
22 from tools.translate import _
25 class crm_merge_opportunity_assign_partner(osv.osv_memory):
26 """Merge two Opportunities"""
28 _inherit = 'crm.merge.opportunity'
30 def _update_data(self, op_ids, oldest_opp):
31 data = super(crm_merge_opportunity_assign_partner, self)._update_data(op_ids, oldest_opp)
34 'partner_latitude': self._get_first_not_null('partner_latitude', op_ids, oldest_opp),
35 'partner_longitude': self._get_first_not_null('partner_longitude', op_ids, oldest_opp),
36 'partner_assigned_id': self._get_first_not_null_id('partner_assigned_id', op_ids, oldest_opp),
37 'date_assign' : self._get_first_not_null('date_assign', op_ids, oldest_opp),
42 crm_merge_opportunity_assign_partner()