Friday, February 21, 2025
2 changes · master
Resolved issues and error corrections
This fix allows businesses using Chilean or Peruvian electronic invoicing with Point of Sale to combine multiple POS orders into a single global invoice. It prevents invoicing errors when restaurants or shops consolidate several orders, improving reliability for daily closing and compliance workflows.
Original PR description
*: [cl, pe] Steps to reproduce: -------------------------- - Install pos_restaurant and any of above localization. - Create multiple orders. - Try to create global invoice of those orders. Issue: -------- - For global invoice feature we allowed multiple orders to be consolidated and can be generated a single invoice which was not handled in l10n modules. Cause: --------- - We were using directly self.field_name to access some values which now can't be supported due to multiple orders in self. Fix: ----- - We adapted the code to have consolidated invoices based on the mapped values. Runbot Error Task: ------------------------- https://runbot.odoo.com/odoo/action-573/134660 https://runbot.odoo.com/odoo/action-573/134661 Related PR: https://github.com/odoo/odoo/pull/198256
Odoo now returns more appropriate error statuses when requests fail, helping integrations and clients better understand what went wrong. This makes error handling clearer without changing core business workflows.
Original PR description
Historically Odoo always returned 400 as the default "4xx" http status code for when the customer screwed up. But 400 is actually reserved for when the http request is malformed, i.e. there was an…
Historically Odoo always returned 400 as the default "4xx" http status code for when the customer screwed up. But 400 is actually reserved for when the http request is malformed, i.e. there was an error while parsing the headers or the body (according strickly to Content-Type). The default go-to error for when the request is syntaxically valid but otherwise garbage is 422 - Unprocessable Entity. Access Denied uses 403 - Forbidden and not 401 - Unauthorized because 401 mandates the use of the `WWW-Authenticate` and `Authorization` headers which don't apply in Odoo. Missing Error uses 404 - Not Found and not 410 - Gone because Missing Error is not only used when trying to write on a deleted record, it also applies when trying to write on a record that never existed. Used the opportunity to visit some other places where we used 400 and to use a http error that is better indicated. See https://httpwg.org/specs/rfc9110.html#status.4xx for the latest specification of HTTP status codes. task-4284096