Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1693 Vizualizări

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
]



Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 25
1115
2
aug. 24
1657
1
iul. 24
2958
2
dec. 23
3117
1
oct. 23
7562