[FIX] point_of_sale: fix weighing scale
Before this commit, the weighing scale was not working properly. This
was caused by commit 60f41b1f83, which modified the getAddProductOptions
function to return both the quantity and weight, instead of just the
quantity.
The "weight" value returned was not handled in the subsequent
"add_product" call stack, causing the weighing functionality to fail.
This commit fixes the issue by using the quantity value instead of
weight in the relevant code paths. In the point of sale context,
quantity and weight are interchangeable depending on the use case.
This commit fixes the associated tests to check the weight of added
order line.
Related to PR https://github.com/odoo/enterprise/pull/47211
opw-3487707
closes odoo/odoo#135432
X-original-commit: ab88f96de580250d1e8cad7e49833c51bd6749e7
Related: odoo/enterprise#47379
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
@@ -138,7 +138,7 @@ export class Product extends PosModel {
|
||||
}
|
||||
async getAddProductOptions(code) {
|
||||
let price_extra = 0.0;
|
||||
let draftPackLotLines, weight, description, packLotLinesToEdit, attribute_value_ids;
|
||||
let draftPackLotLines, description, packLotLinesToEdit, attribute_value_ids;
|
||||
let quantity = 1;
|
||||
let comboLines = [];
|
||||
|
||||
@@ -246,7 +246,7 @@ export class Product extends PosModel {
|
||||
}
|
||||
);
|
||||
if (confirmed) {
|
||||
weight = payload.weight;
|
||||
quantity = payload.weight;
|
||||
} else {
|
||||
// do not add the product;
|
||||
return;
|
||||
@@ -259,7 +259,6 @@ export class Product extends PosModel {
|
||||
return {
|
||||
draftPackLotLines,
|
||||
quantity,
|
||||
weight,
|
||||
description,
|
||||
price_extra,
|
||||
comboLines,
|
||||
|
||||
Reference in New Issue
Block a user