[FIX] point_of_sale: Prevent traceback if opening cash is empty
A TypeError traceback that occurs in `set_cashbox_pos` was caught by Sentry. If the user validates the openingCash with an empty input, the clientside code sends an empty string instead of a number to the python code which interprets it as a number. https://github.com/odoo/odoo/blob/84347b43063fc3032da3e03b49fc57375d8324fc/addons/point_of_sale/models/pos_session.py#L1480-L1485 opw-3089337 closes odoo/odoo#107303 X-original-commit: 62f0117c0f5fad1cd435c65986d477432de00dfa Signed-off-by: Achraf <abz@odoo.com>
This commit is contained in:
@@ -43,6 +43,10 @@ odoo.define('point_of_sale.CashOpeningPopup', function(require) {
|
||||
handleInputChange() {
|
||||
this.manualInputCashCount = true;
|
||||
this.moneyDetails = null;
|
||||
this.state.notes = "";
|
||||
if (typeof(this.state.openingCash) !== "number") {
|
||||
this.state.openingCash = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user