Hello,
I have a custom report and in this I would like to see data for the move lines whose stock.picking Status is Done.
Below is the code, can anyone help me add the picking state in the code.
Thanks
# -*- coding: utf-8 -*-
from odoo import api, models
class ReportSaleOrderLot(models.AbstractModel):
_name = 'report.abc_sale_order_expiry_lot'
@api.model
def get_report_values(self, docids, data=None):
sale_order_report = self.env['ir.actions.report']._get_report_from_name('abc_sale_order_expiry_lot')
order_id = self.env['sale.order'].browse(docids)
product_categ = []
for line in order_id.order_line:
for move in line.move_ids:
for move_line in move.move_line_ids:
product_categ.append(move_line.product_id.categ_id or '')
# product_categ = [line.product_id.categ_id for line in order_id.order_line]
return {
'doc_ids': docids,
'doc_model': sale_order_report.model,
'docs': order_id,
'product_categ': set(product_categ),
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
1
Beantwoorden
2890
Weergaven
You can do it as follows:
for move in line.move_ids:
if move.picking_id.state == 'done':
for move_line in move.move_line_ids:
product_categ.append(move_line.product_id.categ_id or '')
I hope it works for you
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
0
mrt. 15
|
4350 | ||
|
1
nov. 24
|
18986 | ||
|
0
okt. 24
|
1829 | ||
|
0
aug. 24
|
1629 | ||
|
0
jan. 24
|
2108 |