odoo
odoo copied to clipboard
[FIX] point_of_sale: fix order change on note change
The return value of changesToOrder is missing a line inside the cancelled array, while updating the note of an existing order line. From the POV of a preperation tool, this makes it look like a new item has been added to the order.
https://github.com/user-attachments/assets/618263ac-0a61-42f2-b662-10e1ae63e39f
While recording the video I captured the following values from changesToOrder
// 1st output after the orderline was created
{
"new": [
{
"uuid": "db47ade6-c8e1-47e1-8dcc-8c43ef67de8a",
"name": "Coca-Cola",
"product_id": 100,
"attribute_value_ids": [],
"quantity": 1,
"note": "",
"pos_categ_id": 10,
"pos_categ_sequence": 0
}
],
"cancelled": []
}
// 2nd output after the note was added
{
"new": [
{
"uuid": "db47ade6-c8e1-47e1-8dcc-8c43ef67de8a",
"name": "Coca-Cola",
"product_id": 100,
"attribute_value_ids": [],
"quantity": 1,
"note": "Zero",
"pos_categ_id": 10,
"pos_categ_sequence": 0
}
],
"cancelled": []
}
I would expect the second output to look like this
{
"new": [
{
"uuid": "db47ade6-c8e1-47e1-8dcc-8c43ef67de8a",
"name": "Coca-Cola",
"product_id": 100,
"attribute_value_ids": [],
"quantity": 1,
"note": "Zero",
"pos_categ_id": 10,
"pos_categ_sequence": 0
}
],
"cancelled": [
{
"uuid": "db47ade6-c8e1-47e1-8dcc-8c43ef67de8a",
"name": "Coca-Cola",
"product_id": 100,
"attribute_value_ids": [],
"quantity": 1,
"note": "",
"pos_categ_id": 10,
"pos_categ_sequence": 0
}
]
}
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
That's the expected behavior, we don't want to cancel and recreate but we want to add the note to the current line.
