[MERGE] forward port branch 9.0 up to 8c0b23c239

This commit is contained in:
Christophe Simonis
2018-04-16 10:28:42 +02:00
4 changed files with 12 additions and 5 deletions
@@ -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")})
+2 -2
View File
@@ -5,8 +5,8 @@
<!-- This is a test account for testing with test cards and cannot be used in a live environment -->
<record id="pos_mercury_configuration" model="pos_mercury.configuration">
<field name="name">Mercury Demo</field>
<field name="merchant_id">334160</field>
<field name="merchant_pwd">81303DUR</field>
<field name="merchant_id">755847002</field>
<field name="merchant_pwd">xyz</field>
</record>
</data>
</odoo>
@@ -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())
+4 -1
View File
@@ -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