匹配规则修改
This commit is contained in:
@@ -131,7 +131,7 @@ class PurchaseOrderLine(models.Model):
|
||||
[('name', '=', sale_order_name)])
|
||||
if sale_order:
|
||||
filtered_order_line = sale_order.order_line.filtered(
|
||||
lambda order_line: product_name in order_line.product_id.name
|
||||
lambda order_line: re.search(f'S{product_name}$', order_line.product_id.name)
|
||||
)
|
||||
record.part_number = filtered_order_line.product_id.part_number if filtered_order_line else None
|
||||
record.part_name = filtered_order_line.product_id.part_name if filtered_order_line else None
|
||||
|
||||
@@ -769,8 +769,9 @@ class ReStockMove(models.Model):
|
||||
sale_order = self.env['sale.order'].sudo().search(
|
||||
[('name', '=', sale_order_name)])
|
||||
filtered_order_line = sale_order.order_line.filtered(
|
||||
lambda production: product_name in production.product_id.name
|
||||
lambda production: re.search(f'S{product_name}$', production.product_id.name)
|
||||
)
|
||||
|
||||
if filtered_order_line:
|
||||
move.part_number = filtered_order_line.part_number
|
||||
move.part_name = filtered_order_line.part_name
|
||||
|
||||
Reference in New Issue
Block a user