Skip to content
Snippets Groups Projects
Commit 80bc342d authored by roen-odoo's avatar roen-odoo
Browse files

[FIX] pos_sale: down_payment product not imported


Current behavior:
If you limit the number of product loaded in the pos to 0, and block
loading product in the background you will have a traceback when trying
to apply a down_payment.

Steps to reproduce:
- Settings > POS > Limit products to load > Set 0
- Disable the option "Load product in the background"
- Start a PoS session
- Go in the Quotation / Order screen
- Apply a down payment
- Results in traceback

opw-3113215

closes odoo/odoo#109787

Signed-off-by: default avatarEngels Robin (roen) <roen@odoo.com>
parent ea4ba26d
Branches
Tags
No related merge requests found
......@@ -215,7 +215,11 @@ odoo.define('pos_sale.SaleOrderManagementScreen', function (require) {
'total': lines[i].price_total,
};
}
let down_payment_product = this.env.pos.db.get_product_by_id(this.env.pos.config.down_payment_product_id[0])
let down_payment_product = this.env.pos.db.get_product_by_id(this.env.pos.config.down_payment_product_id[0]);
if (!down_payment_product) {
await this.env.pos._addProducts([this.env.pos.config.down_payment_product_id[0]]);
down_payment_product = this.env.pos.db.get_product_by_id(this.env.pos.config.down_payment_product_id[0]);
}
let down_payment_tax = this.env.pos.taxes_by_id[down_payment_product.taxes_id] || false ;
let down_payment;
if (down_payment_tax) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment