Skip to content

[19.0] [ADD] sale_partner_delay#4100

Open
ivantodorovich wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-add-sale-partner-delay
Open

[19.0] [ADD] sale_partner_delay#4100
ivantodorovich wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-add-sale-partner-delay

Conversation

@ivantodorovich
Copy link
Copy Markdown
Contributor

@ivantodorovich ivantodorovich commented Jan 8, 2026

This module adds a customer-specific delivery lead time field to partners.

When creating sale order lines, the partner's lead time is automatically added to the product's delivery lead time to calculate the total customer lead time.

This is useful when certain customers require additional delivery time due to:

  • Remote locations
  • Special delivery requirements
  • Customs clearance needs
  • Quality control processes

@ivantodorovich ivantodorovich marked this pull request as ready for review January 8, 2026 17:35
@ivantodorovich ivantodorovich changed the title [19.0] [ADD] sale_partner_delay [19.0] [ADD] sale_partner_delay Jan 8, 2026
@ivantodorovich ivantodorovich force-pushed the 19.0-add-sale-partner-delay branch from afe46c8 to e5d20a7 Compare January 15, 2026 17:44
@rousseldenis rousseldenis added this to the 19.0 milestone Jan 19, 2026
Copy link
Copy Markdown
Member

@ioans73 ioans73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional review 👍🏻

Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this clean module, Iván. The approach of overriding _compute_customer_lead and calling super() first to get the product delay, then adding the partner delay on top, is the right way to layer this.

A couple of observations:

In sale_order_line.py, when partner_id is an empty recordset (e.g. during draft order creation before a partner is set), line.order_id.partner_id.sale_delay will return 0 thanks to Odoo's ORM behavior on empty recordsets, so that's safe. Good.

The @api.depends('order_id.partner_id') on the override correctly ensures recomputation when the partner changes, and Odoo merges this with the parent's product_id dependency. The test test_partner_change_recomputes_lead confirms this works.

Registering sale_delay as a commercial field via _commercial_fields is a nice touch -- contacts will inherit the parent company's lead time, which is the expected behavior.

The view placement inside page[@name='sales_purchases']//group[@name='sale'] is well-chosen and consistent with where other sale-related partner fields live.

All CI checks pass. LGTM.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants