-
- Downloads
[FIX] sale: fix duplicated `sale.report` ids
Before this commit, when point of sale order line (in table pos_order_line, Point of Sale app) and empty sale order (in table sale_order, Sales app) shares the same id number, it may create duplicate id in sale_report sql view. Empty sale order is an order with no products, so not connected to sale order line.
Additionally, these duplicates creates some discrepancies between pivot and list view in sale report in Sales app.
This commit fixes the issue by removing sale orders with no order lines.
Steps to reproduce the issue:
-----------------------------
1. Create order in Point of Sale app with minimum pos_order_line id equal to "n"
2. Create empty sale order (no order lines inside) with id equal to "n"
To reproduce issue on runbot, one may check the minimum order line for one of pos orders (assume this is n) and then delete all order lines from sale order with id equal to n.
Current behavior:
----------------------------
There will be two lines in sale_repot sql view with id equal to "-n"
Expected behavior:
----------------------------
Id in sale_report view should be unique
opw-2946444
closes odoo/odoo#105303
X-original-commit: a48d3fedd833768bce292bcb52dcb8d3baf4a291
Signed-off-by:
Victor Feyens (vfe) <vfe@odoo.com>
Please register or sign in to comment