diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 5942dfb98f9..e69364d5ed3 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -240,7 +240,7 @@ class AccountBankStatement(models.Model): raise UserError(_('All the account entries lines must be processed in order to close the statement.')) moves = (moves | st_line.journal_entry_ids) if moves: - moves.post() + moves.filtered(lambda m: m.state != 'posted').post() statement.message_post(body=_('Statement %s confirmed, journal items were created.') % (statement.name,)) statements.link_bank_to_partner() statements.write({'state': 'confirm', 'date_done': time.strftime("%Y-%m-%d %H:%M:%S")}) diff --git a/addons/pos_mercury/data/pos_mercury_demo.xml b/addons/pos_mercury/data/pos_mercury_demo.xml index 5ff1a0d70e4..b242868f8df 100644 --- a/addons/pos_mercury/data/pos_mercury_demo.xml +++ b/addons/pos_mercury/data/pos_mercury_demo.xml @@ -5,8 +5,8 @@ Mercury Demo - 334160 - 81303DUR + 755847002 + xyz diff --git a/addons/pos_mercury/models/pos_mercury_transaction.py b/addons/pos_mercury/models/pos_mercury_transaction.py index cca78872ac5..4d8da0b9a98 100644 --- a/addons/pos_mercury/models/pos_mercury_transaction.py +++ b/addons/pos_mercury/models/pos_mercury_transaction.py @@ -63,7 +63,11 @@ class MercuryTransaction(models.Model): 'SOAPAction': 'http://www.mercurypay.com/CreditTransaction', } - r = urllib2.Request('https://w1.mercurypay.com/ws/ws.asmx', data=xml_transaction, headers=headers) + url = 'https://w1.mercurypay.com/ws/ws.asmx' + if self.env['ir.config_parameter'].sudo().get_param('pos_mercury.enable_test_env'): + url = 'https://w1.mercurycert.net/ws/ws.asmx' + + r = urllib2.Request(url, data=xml_transaction, headers=headers) try: u = urllib2.urlopen(r, timeout=65) response = werkzeug.utils.unescape(u.read()) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index d0483ada943..3e115b02a25 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -110,7 +110,10 @@ class Website(Home): } # /page/website.XXX --> /page/XXX if page.startswith('website.'): - return request.redirect('/page/' + page[8:], code=301) + url = '/page/' + page[8:] + if request.httprequest.query_string: + url += '?' + request.httprequest.query_string + return request.redirect(url, code=301) elif '.' not in page: page = 'website.%s' % page