Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1742 Visualizações

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jul. 25
1203
2
ago. 24
1768
1
jul. 24
3002
2
dez. 23
3160
1
out. 23
7638