-
-
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
[14.0][IMP]product_supplierinfo_for_customer_sale: Search SO by customerinfo #3484
[14.0][IMP]product_supplierinfo_for_customer_sale: Search SO by customerinfo #3484
Conversation
9e85c94
to
b27d22f
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.
LGTM
Use case: if product "Acoustic bloc screens" is sold to customer with customer name "Megablock", customer can ask you to retrieve an order containing the product "Megablock" => user needs to be able to perform search using customer name and/or customer code
With this PR we add a search field with the same properties as "Product" field in SO list view, searching for customer name and code
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, LGTM
@pedrobaeza good to go? :) |
@@ -11,21 +11,30 @@ class SaleOrderLine(models.Model): | |||
|
|||
product_customer_code = fields.Char( | |||
compute="_compute_product_customer_code", | |||
store=True, |
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 is a no-go. You can't convert a field to stored on a table that can be populated with a lot of records.
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.
Thank you for the review, while I get your point I will like to ask how do you would you implement such a feature.
My approach derives by a similar implementation found here https://github.com/OCA/stock-logistics-workflow/blob/14.0/product_supplierinfo_for_customer_picking/models/stock_move.py .
The situation is very similar so I thought that was a possible solution.
For backward compatibility I can also make a migration script for the store
attribute of the field.
But I will like to have you opinion first.
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.
One possibility is to not store the field, and implement the search
attribute
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.
@aleuffre Thank you for your suggestion. I have implemented the changes based on your feedback.
b27d22f
to
45f622c
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.
Functional still ok!
@pedrobaeza code is good now?
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.
/ocabot merge minor
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at e2defab. Thanks a lot for contributing to OCA. ❤️ |
Add a new search field that retrieves all the SOs that contains the product with the given
product_name
orproduct_code
.