Skip to Content
Menu
This question has been flagged

hi all,

how can i show parent category level 1(the highest category in the tree)
in pos report sales , knowing that I added an integer field called level in product.category
We are talking about item categories and not POS item categories

pos_daily_sale.py: 


orders_this_day = [order for order in orders if
order.date_order.date() == dt.datetime.strptime(date_report, "%Y-%m-%d").date()]
orders_line_this_day = [line for pos_order in orders_this_day for line in pos_order.lines]
categorie_ids = set([line.product_id.categ_id for line in orders_line_this_year if line.product_id.categ_id])

categories = [
{
'name': categ.name,
'qty': int(sum([line.qty for line in orders_line_this_day if line.product_id.categ_id.id == categ.id])),
'amount': sum([line.price_subtotal_incl for line in orders_line_this_day if
line.product_id.categ_id.id == categ.id]),
}
for categ in categorie_ids
]



Avatar
Discard
Related Posts Replies Views Activity
0
Aug 24
107
2
Aug 24
223
1
Jul 24
1330
2
Dec 23
1332
1
Oct 23
5573