I would like to automate the calculation of Customer Delivery Time on my Products.
I want to use the longest Vendor Delivery Lead Time.
How easy is this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I would like to automate the calculation of Customer Delivery Time on my Products.
I want to use the longest Vendor Delivery Lead Time.
How easy is this?
UPDATE: A Simpler Method, without the Chatter Notification:
max(record.seller_ids.mapped('delay'), default=3)
You can create a Python Code based Server Action:
Here a default lead time of 3 days will be used if a Vendor has not yet been added to the Product Purchase tab and there will be a Chatter Note added if a Vendor is found.
# custom_ray_odoo # loop through all selected product(s) for record in records: # set lead time to default 3 days lead_time = 3 found_vendor = False # loop through all the vendor(s) on the purchase tab for vendor_price_line in record.seller_ids: if vendor_price_line.delay > lead_time: lead_time = vendor_price_line.delay found_vendor = vendor_price_line.partner_id.name # update the record record.update({ 'sale_delay': lead_time }) if found_vendor: # notify via chatter body='Customer Lead Time updated to %s days based on %s' % (lead_time, found_vendor) record.message_post(body=body)
Note: Enterprise Customers - please contact your Odoo Digital Advisor or Odoo Partner if you want to add this customization to your database so it is fully supported. The code here is a prototype that does not support Product Variants and makes assumptions about how your database is setup. It won't necessarily work "as is" for all Users.
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
5
lis 18
|
6076 | ||
Time condition in automation
Rozwiązane
|
|
1
paź 24
|
1357 | |
customer_lead V16
Rozwiązane
|
|
1
paź 23
|
1394 | |
|
1
wrz 17
|
9155 | ||
|
1
maj 15
|
5482 |