Skip to content

Conversation

@dhx
Copy link

@dhx dhx commented Jan 2, 2026

Return error message directly instead of a UserError to prevent an error when this module is used together with the enterprise subscription module which tries to append its own message:

result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/src/odoo/odoo/api.py", line 469, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/src/enterprise/sale_subscription/models/sale_order.py", line 731, in action_invoice_subscription
raise UserError(self._nothing_to_invoice_error_message())
File "/opt/odoo/src/enterprise/sale_subscription/models/sale_order.py", line 1534, in _nothing_to_invoice_error_message
error_message += _(
TypeError: unsupported operand type(s) for +=: 'UserError' and 'str'

Return error message directly instead of a UserError to prevent an error when this module is used together with the enterprise subscription module which tries to append its own message.
@rousseldenis rousseldenis changed the title [FIX] return text in _nothing_to_invoice_error_message [FIX] sale_invoice_blocking: return text in _nothing_to_invoice_error_message Jan 19, 2026
error = super()._nothing_to_invoice_error_message()
error += _("\n- You may have an invoice blocking reason on the sale order")

return UserError(error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damdam-s The fix seems legit as the error is raised later. Do you know why you did this ?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants