Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复制造订单问题

# Conflicts:
#	sf_manufacturing/models/stock.py
This commit is contained in:
jinling.yang
2024-11-26 10:41:30 +08:00
4 changed files with 19 additions and 9 deletions

View File

@@ -281,6 +281,11 @@ class StockRule(models.Model):
workorder_duration += workorder.duration_expected
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
# 如果订单为空,则获取来源制造订单的销售单
if not sale_order:
mrp_production = self.env['mrp.production'].sudo().search([('name', '=', production.origin)], limit=1)
if mrp_production:
sale_order = self.env['sale.order'].sudo().search([('name', '=', mrp_production.origin)])
if sale_order:
# sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id).create({
@@ -985,11 +990,6 @@ class ReStockMove(models.Model):
res['retrospect_ref'] = production.product_id.name
return res
def _single_manufactuing_mo_generate_origin(self, res):
"""
单个制造订单的完成move单据修改来源为该制造订单关联的销售订单下所有成品相同的制造订单
"""
class ReStockQuant(models.Model):
_inherit = 'stock.quant'