Skip to content
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

stock_vertical_lift: make pkg compute more solid #16

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stock_vertical_lift/models/vertical_lift_operation_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def button_release(self):
self.next_step()

def _render_product_packagings(self, product):
if not product:
return ""
return self.env["ir.qweb"].render(
"stock_vertical_lift.packagings",
self._prepare_values_for_product_packaging(product),
Expand Down Expand Up @@ -343,10 +345,10 @@ def on_barcode_scanned(self, barcode):
@api.depends("current_move_line_id.product_id.packaging_ids")
def _compute_product_packagings(self):
for record in self:
if not record.current_move_line_id:
product = record.mapped("current_move_line_id.product_id")
guewen marked this conversation as resolved.
Show resolved Hide resolved
if not product:
record.product_packagings = ""
continue
product = record.current_move_line_id.product_id
content = self._render_product_packagings(product)
record.product_packagings = content

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def _compute_tray_data(self):
@api.depends("current_inventory_line_id.product_id.packaging_ids")
def _compute_product_packagings(self):
for record in self:
if not record.current_inventory_line_id:
product = record.mapped("current_inventory_line_id.product_id")
guewen marked this conversation as resolved.
Show resolved Hide resolved
if not product:
record.product_packagings = ""
continue
product = record.current_inventory_line_id.product_id
content = self._render_product_packagings(product)
record.product_packagings = content

Expand Down