diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 3707e318b10..484f628c5c0 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -290,6 +290,8 @@ class crm_lead(format_address, osv.osv): def on_change_user(self, cr, uid, ids, user_id, context=None): """ When changing the user, also set a team_id or restrict team id to the ones user_id is member of. """ + if not context: + context = {} if user_id and context.get('team_id'): team = self.pool['crm.team'].browse(cr, uid, context['team_id'], context=context) if user_id in team.member_ids.ids: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 09ae09f9ebb..fe9898b4598 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2452,8 +2452,6 @@ class stock_move(osv.osv): move_qty -= qty for move in todo_moves: - if move.linked_move_operation_ids: - continue #then if the move isn't totally assigned, try to find quants without any specific domain if move.state != 'assigned': qty_already_assigned = move.reserved_availability diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index a6a2e4092a5..500c93104e6 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -379,7 +379,6 @@ class Website(openerp.addons.web.controllers.main.Home): #------------------------------------------------------ class WebsiteBinary(openerp.http.Controller): @http.route([ - '/website/image', '/website/image/', '/website/image//x', '/website/image//', diff --git a/addons/website_sale/models/payment.py b/addons/website_sale/models/payment.py index f632292e8f7..bd0a224b2ee 100644 --- a/addons/website_sale/models/payment.py +++ b/addons/website_sale/models/payment.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- +import logging from openerp import SUPERUSER_ID from openerp.osv import orm, fields +_logger = logging.getLogger(__name__) + class PaymentTransaction(orm.Model): _inherit = 'payment.transaction' @@ -19,12 +22,15 @@ class PaymentTransaction(orm.Model): res = super(PaymentTransaction, self).form_feedback(cr, uid, data, acquirer_name, context=context) # fetch the tx, check its state, confirm the potential SO - tx_find_method_name = '_%s_form_get_tx_from_data' % acquirer_name - if hasattr(self, tx_find_method_name): - tx = getattr(self, tx_find_method_name)(cr, uid, data, context=context) - if tx and tx.state == 'done' and tx.acquirer_id.auto_confirm == 'at_pay_confirm' and tx.sale_order_id and tx.sale_order_id.state in ['draft', 'sent']: - self.pool['sale.order'].action_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=dict(context, send_email=True)) - elif tx and tx.state not in ['cancel', 'error'] and tx.sale_order_id and tx.sale_order_id.state in ['draft']: - self.pool['sale.order'].force_quotation_send(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context) + try: + tx_find_method_name = '_%s_form_get_tx_from_data' % acquirer_name + if hasattr(self, tx_find_method_name): + tx = getattr(self, tx_find_method_name)(cr, uid, data, context=context) + if tx and tx.state == 'done' and tx.acquirer_id.auto_confirm == 'at_pay_confirm' and tx.sale_order_id and tx.sale_order_id.state in ['draft', 'sent']: + self.pool['sale.order'].action_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=dict(context, send_email=True)) + elif tx and tx.state not in ['cancel', 'error'] and tx.sale_order_id and tx.sale_order_id.state in ['draft']: + self.pool['sale.order'].force_quotation_send(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context) + except Exception: + _logger.exception('Fail to confirm the order or send the confirmation email%s', tx and ' for the transaction %s' % tx.reference or '') return res