Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化
This commit is contained in:
@@ -124,14 +124,14 @@ class PurchaseOrderLine(models.Model):
|
||||
if match:
|
||||
product_name = match.group(0)
|
||||
sale_order_name = ''
|
||||
match_sale = re.search(r'(S\d+)', record.product_id.name)
|
||||
match_sale = re.search(r'S(\d+)', record.product_id.name)
|
||||
if match_sale:
|
||||
sale_order_name = match_sale.group(0)
|
||||
sale_order = self.env['sale.order'].sudo().search(
|
||||
[('name', '=', sale_order_name)])
|
||||
if sale_order:
|
||||
filtered_order_line = sale_order.order_line.filtered(
|
||||
lambda order_line: re.search(f'S{product_name}$', order_line.product_id.name)
|
||||
lambda order_line: re.search(f'{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
|
||||
|
||||
@@ -770,7 +770,7 @@ 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: re.search(f'S{product_name}$', production.product_id.name)
|
||||
lambda production: re.search(f'{product_name}$', production.product_id.name)
|
||||
)
|
||||
|
||||
if filtered_order_line:
|
||||
|
||||
Reference in New Issue
Block a user