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

Hi -  with odoo 15 Studio I have to create an additional field in the partner form, which is showing the last delivery date for this partner-id as dropshipping address.
I created a many2one field named "last_delivery" and currently it looks like that:



but it doesn't work - no error, but no result as well - what can I do? I know,  there are records with the dropshipping address I'm looking for.



形象
丢弃
最佳答案

Hi,

Could you change the field type to Datetime from Many2one and see if this work well.

Thanks & Regards

形象
丢弃
编写者

I have to correct me - it works! Thank you!

最佳答案

Hi!

Here's how you can solve your issue with displaying the last delivery date for a dropshipping partner in Odoo 15:

1. Use Odoo Studio Filters:

- Open the Studio tool and modify the partner form.

- Set the last_delivery field as a computed field.

- Write an expression that fetches the latest delivery date for the partner using the related stock.picking records. For example:

record.stock_picking_ids.filtered(lambda p: p.partner_id == record.id and p.dropship).sorted('date_done')[-1].date_done

2. Check Data Setup:

Ensure that your dropshipping records have the correct partner ID and delivery dates populated.

3. Test the Logic:

Save and test the field by navigating to a partner with dropshipping deliveries. 

形象
丢弃