Accept Merge Request #1861: (feature/tool_standard_library_process -> develop)

Merge Request: 匹配规则修改

Created By: @廖丹龙
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1861
This commit is contained in:
廖丹龙
2025-02-26 10:48:29 +08:00
committed by Coding
2 changed files with 3 additions and 2 deletions

View File

@@ -770,8 +770,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