[FIX] snailmail: better tests & delivery address now visible on report
Tests now check for the 'error' field in Pingen repsonse snailmail_external_layout.js now targets the right div closes odoo/odoo#76288 Task: 2588145 & 2583718 X-original-commit: 64ba95bc847f9db661d0e348f8bca1249da0b960 Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// Change address font-size if needed
|
||||
document.addEventListener('DOMContentLoaded', function (evt) {
|
||||
var recipientAddress = document.getElementsByClassName('address row')[0].getElementsByTagName('address')[0];
|
||||
var height = parseFloat(window.getComputedStyle(recipientAddress, null).getPropertyValue('height'));
|
||||
var fontSize = parseFloat(window.getComputedStyle(recipientAddress, null).getPropertyValue('font-size'));
|
||||
recipientAddress.style.fontSize = (85/height) * fontSize + 'px';
|
||||
});
|
||||
var recipientAddress = document.querySelector(".address.row > div[name='address'] > div")
|
||||
var style = window.getComputedStyle(recipientAddress, null);
|
||||
var height = parseFloat(style.getPropertyValue('height'));
|
||||
var fontSize = parseFloat(style.getPropertyValue('font-size'));
|
||||
recipientAddress.style.fontSize = (85 / (height / fontSize)) + 'px';
|
||||
});
|
||||
@@ -22,10 +22,13 @@
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
.article > .address.row > div[name="address"] {
|
||||
.pt-5 {
|
||||
padding-top: 48px !important;
|
||||
}
|
||||
.article > div > .address.row > div[name="address"] {
|
||||
height: 65mm;
|
||||
background-color: #ffffff;
|
||||
padding-top: 23mm;
|
||||
padding-top: 11mm;
|
||||
padding-left: 5mm;
|
||||
padding-bottom: 5mm;
|
||||
left: -20px !important;
|
||||
|
||||
@@ -62,14 +62,14 @@ class TestPingenSend(HttpCase):
|
||||
}
|
||||
|
||||
response = requests.post(self.pingen_url, data=self.data, files=files)
|
||||
if 400 <= response.status_code <= 599:
|
||||
if 400 <= response.status_code <= 599 or response.json()['error']:
|
||||
msg = "%(code)s %(side)s Error: %(reason)s for url: %(url)s\n%(body)s" % {
|
||||
'code': response.status_code,
|
||||
'side': r"%s",
|
||||
'reason': response.reason,
|
||||
'url': self.pingen_url,
|
||||
'body': response.text}
|
||||
if response.status_code <= 499:
|
||||
if response.status_code <= 499 or response.json()['error']:
|
||||
raise requests.HTTPError(msg % "Client")
|
||||
else:
|
||||
_logger.warning(msg % "Server")
|
||||
|
||||
Reference in New Issue
Block a user