diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index b0bca634bd2..c8be5c0925c 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -878,7 +878,7 @@ class account_voucher(osv.osv):
currency_id = journal.currency.id
else:
currency_id = journal.company_id.currency_id.id
- vals['value'].update({'currency_id': currency_id})
+ vals['value'].update({'currency_id': currency_id, 'payment_rate_currency_id': currency_id})
#in case we want to register the payment directly from an invoice, it's confusing to allow to switch the journal
#without seeing that the amount is expressed in the journal currency, and not in the invoice currency. So to avoid
#this common mistake, we simply reset the amount to 0 if the currency is not the invoice currency.
diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml
index f8c2d65f63b..3686cf2aab0 100644
--- a/addons/account_voucher/voucher_sales_purchase_view.xml
+++ b/addons/account_voucher/voucher_sales_purchase_view.xml
@@ -222,6 +222,7 @@
+
diff --git a/addons/auth_ldap/users_ldap.py b/addons/auth_ldap/users_ldap.py
index 92d723af3d9..876337a7b54 100644
--- a/addons/auth_ldap/users_ldap.py
+++ b/addons/auth_ldap/users_ldap.py
@@ -249,7 +249,7 @@ class users(osv.osv):
return user_id
registry = RegistryManager.get(db)
with registry.cursor() as cr:
- cr.execute("SELECT id, active FROM res_users WHERE lower(login)=%s", (login,))
+ cr.execute("SELECT id FROM res_users WHERE lower(login)=%s", (login,))
res = cr.fetchone()
if res:
return False
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 30b3d750978..86d6333d7b1 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -160,6 +160,10 @@ class crm_lead(format_address, osv.osv):
return result, fold
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ if context and context.get('opportunity_id'):
+ action = self._get_formview_action(cr, user, context['opportunity_id'], context=context)
+ if action.get('views') and any(view_id for view_id in action['views'] if view_id[1] == view_type):
+ view_id = next(view_id[0] for view_id in action['views'] if view_id[1] == view_type)
res = super(crm_lead, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if view_type == 'form':
res['arch'] = self.fields_view_get_address(cr, user, res['arch'], context=context)
@@ -586,6 +590,13 @@ class crm_lead(format_address, osv.osv):
attachment.write(values)
return True
+ def _merge_opportunity_phonecalls(self, cr, uid, opportunity_id, opportunities, context=None):
+ phonecall_obj = self.pool['crm.phonecall']
+ for opportunity in opportunities:
+ for phonecall_id in phonecall_obj.search(cr, uid, [('opportunity_id', '=', opportunity.id)], context=context):
+ phonecall_obj.write(cr, uid, phonecall_id, {'opportunity_id': opportunity_id}, context=context)
+ return True
+
def get_duplicated_leads(self, cr, uid, ids, partner_id, include_lost=False, context=None):
"""
Search for opportunities that have the same partner and that arent done or cancelled
@@ -616,6 +627,7 @@ class crm_lead(format_address, osv.osv):
self._merge_notify(cr, uid, highest, opportunities, context=context)
self._merge_opportunity_history(cr, uid, highest, opportunities, context=context)
self._merge_opportunity_attachments(cr, uid, highest, opportunities, context=context)
+ self._merge_opportunity_phonecalls(cr, uid, highest, opportunities, context=context)
def merge_opportunity(self, cr, uid, ids, user_id=False, section_id=False, context=None):
"""
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 47825a5d30c..619fc7cadd6 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -104,7 +104,7 @@
domain="[('object_id.model', '=', 'crm.phonecall')]"/>
-
+
diff --git a/addons/payment/views/payment_acquirer.xml b/addons/payment/views/payment_acquirer.xml
index 6840aa03274..8ff6ed57ace 100644
--- a/addons/payment/views/payment_acquirer.xml
+++ b/addons/payment/views/payment_acquirer.xml
@@ -108,7 +108,7 @@