Skip to Content
Menu
This question has been flagged
1 Reply
1297 Views

In ZATCA, we have moved to production, and all the setups are completed, but invoices are not being sent automatically to the ZATCA portal. We have more than 25 shops, and invoices are created every minute but are not being processed to the ZATCA portal. We found a scheduled action named 'EDI: Perform web services operations.' Is this related to ZATCA, or do we need to create an automatic one? Please suggest a solution. We need a quick and urgent reply from your side. Additionally, when I clicked "Run Manually," I encountered an error message.

Error Message 

2024-09-01 10:59:05,615 332460 ERROR odoo.addons.base.models.ir_cron: Call from cron EDI : Perform web services operations for server action #262 failed in Job #12

Traceback (most recent call last):

File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 386, in safe_eval

return unsafe_eval(c, globals_dict, locals_dict)

File "", line 1, in

File "/home/odoo/src/odoo/addons/account_edi/models/account_edi_document.py", line 267, in _cron_process_documents_web_services

nb_remaining_jobs = edi_documents._process_documents_web_services(job_count=job_count)

File "/home/odoo/src/odoo/addons/account_edi/models/account_edi_document.py", line 254, in _process_documents_web_services

self._process_job(documents, doc_type)

File "/home/odoo/src/odoo/addons/account_edi/models/account_edi_document.py", line 203, in _process_job

edi_result = edi_format._post_invoice_edi(invoices)

File "/home/odoo/src/odoo/addons/l10n_sa_edi/models/account_edi_format.py", line 455, in _post_invoice_edi

return {invoice: self._l10n_sa_post_zatca_edi(invoice)}

File "/home/odoo/src/odoo/addons/l10n_sa_edi/models/account_edi_format.py", line 328, in _l10n_sa_post_zatca_edi

xml_content = invoice._l10n_sa_generate_unsigned_data()

File "/home/odoo/src/odoo/addons/l10n_sa_edi/models/account_move.py", line 151, in _l10n_sa_generate_unsigned_data

invoice_hash_hex = self.env['account.edi.xml.ubl_21.zatca']._l10n_sa_generate_invoice_xml_hash(xml_content).decode()

File "/home/odoo/src/odoo/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py", line 77, in _l10n_sa_generate_invoice_xml_hash

xml_sha = self._l10n_sa_generate_invoice_xml_sha(xml_content)

File "/home/odoo/src/odoo/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py", line 64, in _l10n_sa_generate_invoice_xml_sha

root = etree.fromstring(xml_content)

File "src/lxml/etree.pyx", line 3235, in lxml.etree.fromstring

File "src/lxml/parser.pxi", line 1875, in lxml.etree._parseMemoryDocument

ValueError: can only parse strings


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

File "/home/odoo/src/odoo/odoo/addons/base/models/ir_cron.py", line 390, in _callback

self.env['ir.actions.server'].browse(server_action_id).run()

File "/home/odoo/src/odoo/odoo/addons/base/models/ir_actions.py", line 649, in run

res = runner(run_self, eval_context=eval_context)

File "/home/odoo/src/odoo/odoo/addons/base/models/ir_actions.py", line 518, in _run_action_code_multi

safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'

File "/home/odoo/src/odoo/odoo/tools/safe_eval.py", line 402, in safe_eval

raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))

ValueError: : "can only parse strings" while evaluating

'model._cron_process_documents_web_services(job_count=20)'

Avatar
Discard
Best Answer

- Look for any functions in _cron_process_documents_web_services that involve parsing or converting data, such as int(), float(), str(), datetime.strptime(), etc. Verify that these functions are receiving the correct type of input.

thanks

Avatar
Discard
Author

We are using the odoo sh server, how can I resolve this error because error shows in the odoo default addons

If there's anything I can assist you with, please let me know and I'd be happy to help!

Related Posts Replies Views Activity
0
Sep 24
1225
0
May 24
828
0
May 24
1083
0
May 24
1158
1
Mar 25
1226