Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] l10n_uy_ux: Re-Print PDF on demo mode #288

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

fw-bot-adhoc
Copy link
Contributor

The PDF is generated when doing send and print and the logic is already solved to skip real PDF generation on demo mode.

However, in this module we have an extra method ro Re-generate the PDF and attached to the invoice.

If we try to do this in demo mode will fail because it tries to connecto to uruware wo real elements. With this change if we are in demo mode re-print will re generate odoo PDF and will not retrieve any traceback error.

Current behavior

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/http.py", line 1783, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/http.py", line 1810, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/http.py", line 2014, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/data/build/adhoc-cicd-odoo-odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/addons/base/models/ir_http.py", line 225, in _dispatch
    result = endpoint(**request.params)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/http.py", line 757, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/data/build/adhoc-cicd-odoo-odoo/addons/web/controllers/dataset.py", line 28, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/data/build/adhoc-cicd-odoo-odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/data/build/adhoc-cicd-odoo-odoo/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/data/build/ingadhoc-uruguay/l10n_uy_ux/models/account_move.py", line 174, in action_l10n_uy_get_pdf
    pdf_result = self._l10n_uy_edi_get_pdf()
  File "/data/build/adhoc-cicd-odoo-enterprise/l10n_uy_edi/models/account_move.py", line 655, in _l10n_uy_edi_get_pdf
    result = self.l10n_uy_edi_document_id._get_pdf()
  File "/data/build/adhoc-cicd-odoo-enterprise/l10n_uy_edi/models/l10n_uy_edi_document.py", line 233, in _get_pdf
    result = self._ucfe_query(report_params, req_data)
  File "/data/build/adhoc-cicd-odoo-enterprise/l10n_uy_edi/models/l10n_uy_edi_document.py", line 397, in _ucfe_query
    return self._ucfe_ws_call(company, "query", method, **req_data)
  File "/data/build/adhoc-cicd-odoo-enterprise/l10n_uy_edi/models/l10n_uy_edi_document.py", line 404, in _ucfe_ws_call
    if not url.endswith("?wsdl"):
AttributeError: 'bool' object has no attribute 'endswith'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
        at makeErrorFromResponse (https://114463-17-0-all.runbot.adhoc.com.ar/web/assets/18f8651/web.assets_web.min.js:2918:163)
        at XMLHttpRequest.<anonymous> (https://114463-17-0-all.runbot.adhoc.com.ar/web/assets/18f8651/web.assets_web.min.js:2922:13)

Forward-Port-Of: #287

@roboadhoc
Copy link
Contributor

@fw-bot-adhoc
Copy link
Contributor Author

@zaoral @jue-adhoc this PR targets 18.0 and is the last of the forward-port chain.

To merge the full chain, use

@fw-bot-adhoc r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@zaoral zaoral force-pushed the 18.0-17.0-t-85822-v2-kz-3nDF-fw branch from 28b4bcb to a613b21 Compare January 23, 2025 15:51
@fw-bot-adhoc
Copy link
Contributor Author

@zaoral @jue-adhoc this PR was modified / updated and has become a normal PR. It should be merged the normal way (via @roboadhoc)

The PDF is generated when doing send and print and the logic
is already solved to skip real PDF generation on demo mode.

However, in this module we have an extra method ro Re-generate
the PDF and attached to the invoice.

If we try to do this in demo mode will fail because it tries
to connecto to uruware wo real elements. With this change
if we are in demo mode re-print will re generate odoo PDF
and will not retrieve any traceback error.

X-original-commit: 893ac8d
@zaoral zaoral force-pushed the 18.0-17.0-t-85822-v2-kz-3nDF-fw branch from a613b21 to e7f1db4 Compare January 23, 2025 21:27
@zaoral
Copy link
Contributor

zaoral commented Jan 23, 2025

@roboadhoc r+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants