-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] sale_lead_time #3539
base: 16.0
Are you sure you want to change the base?
Conversation
2619b9b
to
e9a7924
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review.
d0fe46b
to
0ff8e28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very very specific too me, with too many hardcoded values, and doesn't look specific enough to applicable in other contexts...
score += 1 | ||
else: | ||
return -1 | ||
if self.partner_id: | ||
if partner == self.partner_id: | ||
score += 3 | ||
else: | ||
return -1 | ||
elif self.state_id: | ||
if partner.state_id == self.state_id: | ||
score += 2 | ||
else: | ||
return -1 | ||
elif self.country_id: | ||
if partner.country_id == self.country_id: | ||
score += 1 | ||
else: | ||
return -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make those configurable. Also, I think it lacks some comments. Why is partner +3 and not +42? I feel like this should be configured on the company.
And as I see it, I'm thinking that maybe we could sum values.
For a given profile, profile score is warehouse score + partner score + …, according to what the customer wants to.
@mmequignon Thanks for your comments! Can you please check the updated code? |
d8232e8
to
12203a8
Compare
f1cc0f4
to
d4a7f4d
Compare
sale_lead_time/models/sale_order.py
Outdated
continue | ||
partner_address_domain = rec._get_partner_address_domain() | ||
warehouse_domain = rec._get_warehouse_domain() | ||
domain = expression.AND([partner_address_domain, warehouse_domain]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to include the company in the domain.
domain = expression.AND([partner_address_domain, warehouse_domain]) | |
domain = expression.AND([partner_address_domain, warehouse_domain, [("company_id", "=", rec.company_id.id)]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review.
@AungKoKoLin1997 Can you please squash commits?
@@ -0,0 +1,4 @@ | |||
This module enhances the sales order process by adding a delivery_lead_time that is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module enhances the sales order process by adding a delivery_lead_time that is | |
This module enhances the sales order process by adding a Delivery Lead Lime that is |
sale_lead_time/readme/CONFIGURE.rst
Outdated
| Japan | Tokyo | | 2nd WH | 7.0 | N/A for warehouse mismatch | | ||
+---------+-------+---------+-----------+------------------+-------------------------------+ | ||
|
||
As a result, 5.0 days of the Delivery Lead Time will be proposed for the sales order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a result, 5.0 days of the Delivery Lead Time will be proposed for the sales order. | |
The profile with the highest score is considered the best match, and therefore, a | |
Delivery Lead Time of 5.0 days will be proposed for the sales order. |
d318b86
to
d58c6e8
Compare
d58c6e8
to
c818996
Compare
This module enhances the sales order process by adding a delivery_lead_time that is determined based on the most closely matching lead time profile. This time is then incorporated into the customer_lead of each sale order line, optimizing delivery scheduling based on specific lead time configurations.
@qrtl QT4790