diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index 605a71e8b80..cdc858dbbd6 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -77,10 +77,15 @@ class sale_order_line(osv.osv): list_price = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order }) - pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount']) + so_pricelist = pricelist_obj.browse(cr, uid, pricelist, context=context) new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist) - if len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0 and new_list_price != 0: + if so_pricelist.visible_discount and list_price[pricelist] != 0 and new_list_price != 0: + if so_pricelist.currency_id.id != product.company_id.currency_id.id: + # new_list_price is in company's currency while price in pricelist currency + new_list_price = self.pool['res.currency'].compute(cr, uid, + product.company_id.currency_id.id, so_pricelist.currency_id.id, + new_list_price, context=context) discount = (new_list_price - price) / new_list_price * 100 if discount > 0: result['price_unit'] = new_list_price diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index bb4185cef0b..3dae521bf26 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -193,8 +193,8 @@
- Create a free website with - OpenERP + Create a free website with + Odoo
Copyright © Company name diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 75262b7af90..12756519ee2 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -673,6 +673,7 @@ class Ecommerce(http.Controller): acquirer_form_post_url = payment_obj.get_form_action_url(cr, uid, acquirer_id, context=context) acquirer_total_url = '%s?%s' % (acquirer_form_post_url, werkzeug.url_encode(post)) + request.registry['sale.order'].action_button_confirm(cr, SUPERUSER_ID, [order.id], context=request.context) return request.redirect(acquirer_total_url) @http.route('/shop/payment/get_status/', type='json', auth="public", website=True, multilang=True) diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index e658ddc0fe7..3c3509b8712 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -31,6 +31,7 @@ + @@ -183,8 +184,8 @@ - + + diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index fc0d1e1c973..f83a31b04ad 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -1402,6 +1402,16 @@ class BaseModel(object): # Failed to write, log to messages, rollback savepoint (to # avoid broken transaction) and keep going cr.execute('ROLLBACK TO SAVEPOINT model_load_save') + except Exception, e: + message = (_('Unknown error during import:') + + u' %s: %s' % (type(e), unicode(e))) + moreinfo = _('Resolve other errors first') + messages.append(dict(info, type='error', + message=message, + moreinfo=moreinfo)) + # Failed for some reason, perhaps due to invalid data supplied, + # rollback savepoint and keep going + cr.execute('ROLLBACK TO SAVEPOINT model_load_save') if any(message['type'] == 'error' for message in messages): cr.execute('ROLLBACK TO SAVEPOINT model_load') ids = False @@ -4085,6 +4095,8 @@ class BaseModel(object): self._transient_vacuum(cr, user) self.check_access_rights(cr, user, 'create') + + vals = self._add_missing_default_values(cr, user, vals, context) if self._log_access: for f in LOG_ACCESS_COLUMNS: @@ -4092,7 +4104,6 @@ class BaseModel(object): _logger.warning( 'Field `%s` is not allowed when creating the model `%s`.', f, self._name) - vals = self._add_missing_default_values(cr, user, vals, context) tocreate = {} for v in self._inherits: