-
-
Notifications
You must be signed in to change notification settings - Fork 1.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][FIX] sale_order_product_recommendation: recommendations on sales with section or notes #3660
base: 16.0
Are you sure you want to change the base?
[16.0][FIX] sale_order_product_recommendation: recommendations on sales with section or notes #3660
Conversation
Hi @yajo, @rafaelbn, @sergio-teruel, |
6ac417c
to
3fe70c0
Compare
@@ -160,7 +160,9 @@ def generate_recommendations(self): | |||
existing_product_ids = set() | |||
# Always recommend all products already present in the linked SO except delivery | |||
# carrier products | |||
for line in self.order_id.order_line.filtered(lambda ln: not ln._is_delivery()): | |||
for line in self.order_id.order_line.filtered( | |||
lambda ln: not (ln._is_delivery() or ln.display_type) |
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.
Could you add a test with a note or section ?
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.
@Tisho99 LGTM Reviewed on local enviroment.
3fe70c0
to
63880d5
Compare
@@ -127,6 +127,21 @@ def test_recommendations_ordered_by_code(self): | |||
], | |||
) | |||
|
|||
def test_recommendations_with_note(self): |
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.
What do you do in this test?
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.
Generate the recomendations with the wizard in a sale order with notes. It is what gives an error without the fix
…h section or notes
63880d5
to
7a0baff
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.
Technical reviw. LGTM
If you try to use the recommendation wizard in a sales order with section or notes, an error will be displayed when trying to get the recommendations.
The reason is because it tries to read the section's product, and it does not exist.
This PR fixes it
I-7204