[FIX] point_of_sale: Include uncategorized products in sales report

Prior to this commit, products without assigned categories were not
displayed in the sales details report. This issue was due to the
report's logic excluding products that did not fall under any
specific POS category.

This commit introduces a change where products without categories are
now considered under a default category named "Not Categorized" in the
sales report. This ensures that all products, regardless of category
status, are accounted for and visible in the sales details, improving
the comprehensiveness and accuracy of the report.

opw-3594985

closes odoo/odoo#143440

X-original-commit: 6b7afc9f16133314ff6247f11db002bd3a64d289
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-11-29 16:30:18 +00:00
parent 036c72e5ec
commit 7bbba71bda
2 changed files with 8 additions and 1 deletions
@@ -3828,6 +3828,13 @@ msgstr ""
msgid "None"
msgstr ""
#. module: point_of_sale
#. odoo-python
#: code:addons/point_of_sale/models/report_sale_details.py:0
#, python-format
msgid "Not Categorized"
msgstr ""
#. module: point_of_sale
#: model_terms:ir.ui.view,arch_db:point_of_sale.view_report_pos_order_search
msgid "Not Invoiced"
@@ -282,7 +282,7 @@ class ReportSaleDetails(models.AbstractModel):
def _get_products_and_taxes_dict(self, line, products, taxes, currency):
key2 = (line.product_id, line.price_unit, line.discount)
keys1 = line.product_id.product_tmpl_id.pos_categ_ids.mapped("name")
keys1 = line.product_id.product_tmpl_id.pos_categ_ids.mapped("name") or [_('Not Categorized')]
for key1 in keys1:
products.setdefault(key1, {})
products[key1].setdefault(key2, 0.0)