[14.0]account_ebics - fix _process_result_action

This commit is contained in:
Luc De Meyer 2022-10-17 21:24:06 +02:00
parent b0b5ca9e57
commit 4b020289fa
2 changed files with 7 additions and 8 deletions

View File

@ -3,7 +3,7 @@
{ {
"name": "EBICS banking protocol", "name": "EBICS banking protocol",
"version": "14.0.1.0.4", "version": "14.0.1.0.5",
"license": "LGPL-3", "license": "LGPL-3",
"author": "Noviat", "author": "Noviat",
"website": "www.noviat.com", "website": "www.noviat.com",

View File

@ -168,15 +168,14 @@ class EbicsFile(models.Model):
return False return False
return True return True
def _process_result_action(self, res, parser="oca"): def _process_result_action(self, res):
notifications = [] notifications = []
st_line_ids = [] st_line_ids = []
statement_ids = [] statement_ids = []
sts_data = [] sts_data = []
if parser == "oca": if res.get("type") and res["type"] == "ir.actions.client":
if res.get("context"): notifications = res["context"].get("notifications", [])
notifications = res["context"].get("notifications", []) st_line_ids = res["context"].get("statement_line_ids", [])
st_line_ids = res["context"].get("statement_line_ids", [])
if notifications: if notifications:
for notif in notifications: for notif in notifications:
parts = [] parts = []
@ -206,7 +205,7 @@ class EbicsFile(models.Model):
(tuple(st_line_ids),), (tuple(st_line_ids),),
) )
sts_data = self.env.cr.dictfetchall() sts_data = self.env.cr.dictfetchall()
elif parser == "oe": else:
if res.get("res_id"): if res.get("res_id"):
st_ids = res["res_id"] st_ids = res["res_id"]
else: else:
@ -429,7 +428,7 @@ class EbicsFile(models.Model):
_("No financial journal found for Company Bank Account %s") _("No financial journal found for Company Bank Account %s")
% bank_account % bank_account
) )
return self._process_result_action(res, parser="oe") return self._process_result_action(res)
@staticmethod @staticmethod
def _unlink_camt053(self): def _unlink_camt053(self):