From 0023955074c146c19da8e51798ea3ec0c7f01da4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 1 Aug 2014 14:48:16 +0200 Subject: [PATCH 1/7] [FIX] website_sale: confirm sale order on payment_confirmation Same behavior than in saas-5 --- addons/website_sale/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 1871dd64e02..083f9651fd1 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) From b20636e0b2fa8590c9b80862249b98689cbcf285 Mon Sep 17 00:00:00 2001 From: Julien Legros Date: Fri, 1 Aug 2014 15:33:58 +0200 Subject: [PATCH 2/7] [FIX] website: update url in the footer --- addons/website/views/website_templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 5932931688a..312db8c6e76 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -192,8 +192,8 @@
- Create a free website with - OpenERP + Create a free website with + OpenERP
Copyright © Company name From eb775fc2ead0133f735d94af8b0fa275827d4bbe Mon Sep 17 00:00:00 2001 From: dhr-odoo Date: Wed, 9 Jul 2014 12:53:36 +0530 Subject: [PATCH 3/7] [FIX] orm: set default before removing magic fields When a record is created, the magic fields (id, create_date,...) are first removed from the vals as the user should not set a value for these. However if a value for this is given in default value (e.g. defined in an ir.value), the creation would crash (sql error : column specified more than once) as the magic column would be added again. --- openerp/osv/orm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 0a38ccf03d4..f0c8337ea6d 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -4394,6 +4394,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: @@ -4401,7 +4403,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: From f6fb2b69df826cd582bd04b3b4d3b348d44067c0 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 1 Aug 2014 12:43:31 +0200 Subject: [PATCH 4/7] [FIX] product_visible_discount: multicurrency pricelists When we compute the discount of a product to display (result of product_id_change), we compare prices in the currency of the product while we expect prices in the currency of the pricelist. opw 606188 --- .../product_visible_discount/product_visible_discount.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index b8a6e4552ea..275bfcd68b1 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -84,10 +84,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 From 19e401adf0d85f07a013c29d64690bd4c88a92e6 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 1 Aug 2014 17:07:56 +0200 Subject: [PATCH 5/7] [IMP] base: show possible titles for companies (opw 608243) --- openerp/addons/base/res/res_partner_view.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index 724cce7bb5f..5f4cd26bbd7 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -31,6 +31,7 @@ + @@ -179,8 +180,8 @@ - + + From 9411a2da03ebfe9d1aeacc43c8bd789a64f647e9 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 1 Aug 2014 22:42:01 +0200 Subject: [PATCH 6/7] [FIX] Model.load(): extra error checking while importing data If any missing or partially incorrect values cause an exception other than a psycopg2 error, we should still catch it, rollback that record and report the error, rather than letting bubble and fail without any feedback to the user. Fixes #1485 --- openerp/osv/orm.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index f0c8337ea6d..00093999bca 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -1389,6 +1389,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 From fc920279797f8aef09c6e40b4b2fc1682823382e Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 1 Aug 2014 23:04:42 +0200 Subject: [PATCH 7/7] [FIX] website: OpenERP->Odoo in website footer --- addons/website/views/website_templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 312db8c6e76..be3ad6a5a1e 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -193,7 +193,7 @@
Create a free website with - OpenERP + Odoo
Copyright © Company name