Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1212 Weergaven

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.



Avatar
Annuleer
Beste antwoord

Hi,

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

Thanks & Regards

Avatar
Annuleer
Auteur

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

Beste antwoord

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. 

Avatar
Annuleer