跳至内容
菜单
此问题已终结
1 回复
822 查看

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

形象
丢弃
编写者 最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
8月 25
892
3
7月 25
350
2
7月 25
1042
1
5月 25
783
0
5月 25
933