Skip to content
Merged
Changes from all commits
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
15 changes: 1 addition & 14 deletions stock_picking_line_sequence/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,11 @@ class StockMoveLine(models.Model):
_inherit = "stock.move.line"

def _get_aggregated_product_quantities(self, **kwargs):
def get_aggregated_properties(move_line=False, move=False):
move = move or move_line.move_id
uom = move.product_uom or move_line.product_uom_id
name = move.product_id.display_name
description = move.description_picking
if description == name or description == move.product_id.name:
description = False
product = move.product_id
line_key = (
f"{product.id}_{product.display_name}_" f'{description or ""}_{uom.id}'
)
return line_key

aggregated_move_lines = super(
StockMoveLine, self
)._get_aggregated_product_quantities(**kwargs)
for move_line in self:
line_key = get_aggregated_properties(move_line=move_line)
line_key = self._get_aggregated_properties(move_line=move_line)["line_key"]
sequence2 = move_line.move_id.sequence2
if line_key in aggregated_move_lines:
aggregated_move_lines[line_key]["sequence2"] = sequence2
Expand Down