[FIX] partner_autocomplete: display insufficient credit notification.

Before this commit the error 'Insufficient Credit' was not triggered by the python side, so the notification was never displayed.

closes odoo/odoo#37649

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
This commit is contained in:
Pierre Rousseau
2019-10-01 06:42:52 +00:00
parent 3bd70d91fe
commit cef2bbd12f
@@ -127,7 +127,12 @@ class ResPartner(models.Model):
else:
result = {}
if error:
if response and response.get('credit_error'):
result.update({
'error': True,
'error_message': 'Insufficient Credit'
})
elif error:
result.update({
'error': True,
'error_message': error