Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
864 Visualizzazioni

Hello,

Odoo is referencing the sales order for a reference in every invoice.

In our use case we bill the customer by deliverd items.
So we want to reference the delivery slip in the invoice.

I already tried several solutions in Odoo Studio but failed with a rendering error or not the wanted result.

Attempts so far:


<t t-out="max(env['stock.picking'].search([('origin', '=', object.invoice_origin)]), key=lambda p: p.scheduled_date).name if object.invoice_origin else 'No delivery slip found'"/>


<t t-out="object.invoice_origin and object.invoice_origin[0].picking_ids and object.invoice_origin[0].picking_ids[0].name or 'No delivery slip found'"/>


But also broken down it is not working  o.sale_id.picking_ids[0].name


Thanks in advance and best Regards

Avatar
Abbandona
Autore Risposta migliore

For now we stick to copying the delivery number into the reference.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
ago 25
971
3
lug 25
437
2
lug 25
1099
1
mag 25
833
0
mag 25
992