-
-
Notifications
You must be signed in to change notification settings - Fork 654
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][MIG] stock_picking_quick #1088
Conversation
Currently translated at 100.0% (10 of 10 strings) Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-stock_picking_quick Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_quick/pt_BR/
Currently translated at 100.0% (10 of 10 strings) Translation: stock-logistics-workflow-12.0/stock-logistics-workflow-12.0-stock_picking_quick Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_quick/sl/
/ocabot migration stock_picking_quick |
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
from odoo.tests.common import Form, TransactionCase | ||
|
||
|
||
class TestQuickPicking(TransactionCase): |
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.
Please use SavepointCase
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.
In v15 TransactionCase Include SavepointCase feature, but yes, not in v14
self.env.context.get("parent_id") | ||
) | ||
if picking: | ||
moves = self.env["stock.move"].search([("picking_id", "=", picking.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.
You should do this to avoid a search():
moves = self.env["stock.move"].search([("picking_id", "=", picking.id)]) | |
args.append(("move_ids.picking_id", "=", picking.id)) |
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
move_ids = fields.One2many( |
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.
There is already that field in core :
https://github.com/odoo/odoo/blob/14.0/addons/stock/models/product.py#L27
@api.depends("move_ids") | ||
def _compute_process_qty(self): | ||
res = super(ProductProduct, self)._compute_process_qty() | ||
if self.env.context.get("parent_model", False) == "stock.picking": |
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.
You should add a depends_context for that entry
25bb52a
to
77c06e8
Compare
@rousseldenis Thank you for your time, I apply your suggestions. |
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. A great addition as the module has now a quite long history, is to add test for product related code. @Kev-Roche
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
/ocabot merge patch |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 87f3147. Thanks a lot for contributing to OCA. ❤️ |
migration of module stock_picking_quick
cc @bealdav, @PierrickBrun