-
-
Notifications
You must be signed in to change notification settings - Fork 230
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][MIG] stock_report_quantity_by_location: Migration to version 16.0 #298
[16.0][MIG] stock_report_quantity_by_location: Migration to version 16.0 #298
Conversation
Currently translated at 96.3% (26 of 27 strings) Translation: stock-logistics-reporting-12.0/stock-logistics-reporting-12.0-stock_report_quantity_by_location Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-12-0/stock-logistics-reporting-12-0-stock_report_quantity_by_location/es_MX/
- Add an option in the wizard 'Quantity > 0' to speed up the report
…ilability. New field 'availability' in the wizard, allowing you to report on quantities on hand, or quantities unreserved (on hand - reservations).
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-reporting-13.0/stock-logistics-reporting-13.0-stock_report_quantity_by_location Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-13-0/stock-logistics-reporting-13-0-stock_report_quantity_by_location/
Currently translated at 100.0% (35 of 35 strings) Translation: stock-logistics-reporting-15.0/stock-logistics-reporting-15.0-stock_report_quantity_by_location Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-15-0/stock-logistics-reporting-15-0-stock_report_quantity_by_location/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-reporting-15.0/stock-logistics-reporting-15.0-stock_report_quantity_by_location Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-reporting-15-0/stock-logistics-reporting-15-0-stock_report_quantity_by_location/
/ocabot migration stock_report_quantity_by_location |
4d43985
to
3a8a586
Compare
class TestStockReportQuantityByLocation(TransactionCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super(TestStockReportQuantityByLocation, cls).setUpClass() |
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.
Apply PEP 3135 (28-Apr-2007) to "super()."
qty_on_hand = qty_dict.get("quantity_on_hand", 0.0) | ||
qty_reserved = qty_dict.get("quantity_reserved", 0.0) | ||
qty_unreserved = qty_dict.get("quantity_unreserved", 0.0) | ||
if (self.with_quantity and qty_on_hand) or not self.with_quantity: |
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 would not be the same as this:
if (self.with_quantity and qty_on_hand) or not self.with_quantity: | |
if not self.with_quantity or qty_on_hand: |
} | ||
) | ||
recs = self.env["stock.report.quantity.by.location"].create(vals_list) | ||
return recs.ids |
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 method does not need to return anything, you can remove recs.
"default_code": product.default_code, | ||
} | ||
) | ||
recs = self.env["stock.report.quantity.by.location"].create(vals_list) |
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.
can do this operation only once, moving it out of the for.
3a8a586
to
30c3e4b
Compare
Hi @RodrigoBM, changes done, thanks! 👍🏼 |
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
} | ||
mapping.setdefault(quant_group["product_id"][0], qty_dict) | ||
products = self.env["product.product"].search([("type", "=", "product")]) | ||
vals_list = [] |
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 variable has to be outside the for, if not, only records from the last iteration of location_ids will be created.
30c3e4b
to
b1766c6
Compare
Hi @pedrobaeza, how are you? Could you check the mr and merge it? Thanks! |
Merging based on the reviews and due to @rousseldenis as Logistics PSC approval /ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at d4db922. Thanks a lot for contributing to OCA. ❤️ |
[16.0][MIG] stock_report_quantity_by_location