Compare commits
5 Commits
feature/消息
...
feature/sa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
281f3c67c3 | ||
|
|
64eb66c334 | ||
|
|
9e5dbc0104 | ||
|
|
c57918736d | ||
|
|
1816f1a497 |
@@ -177,9 +177,10 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||
const thead_th_num = thead_tr.children().length
|
||||
const tbody_tr_num = tbody_tr.children().length
|
||||
const num = thead_th_num - tbody_tr_num
|
||||
console.log('num', num);
|
||||
if(num == -1) {
|
||||
thead_tr.prepend('<td>序号</td>')
|
||||
tbody.children('tr').each(function () {
|
||||
$(this).children('td').eq(0).remove()
|
||||
})
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
|
||||
@@ -783,7 +783,7 @@ class MrpProduction(models.Model):
|
||||
workorder.duration_expected = workorder._get_duration_expected()
|
||||
|
||||
# 外协出入库单处理
|
||||
def get_subcontract_pick_purchase(self):
|
||||
def get_subcontract_pick_purchase(self, special_design_workorder):
|
||||
production_all = self.sorted(lambda x: x.id)
|
||||
product_id_to_production_names = {}
|
||||
grouped_product_ids = {k: list(g) for k, g in
|
||||
@@ -792,18 +792,19 @@ class MrpProduction(models.Model):
|
||||
product_id_to_production_names[product_id] = [p.name for p in pd]
|
||||
sorted_workorders = None
|
||||
for production in production_all:
|
||||
proc_workorders = []
|
||||
process_parameter_workorder = self.env['mrp.workorder'].search(
|
||||
[('surface_technics_parameters_id', '!=', False), ('production_id', '=', production.id),
|
||||
('is_subcontract', '=', True), ('state', '!=', 'cancel')], order='sequence asc')
|
||||
if process_parameter_workorder:
|
||||
# 将这些特殊表面工艺工单的采购单与调拨单置为失效
|
||||
for workorder in process_parameter_workorder:
|
||||
workorder._get_surface_technics_purchase_ids().write({'state': 'cancel'})
|
||||
workorder.move_subcontract_workorder_ids.write({'state': 'cancel'})
|
||||
workorder.move_subcontract_workorder_ids.picking_id.write({'state': 'cancel'})
|
||||
# proc_workorders = []
|
||||
# process_parameter_workorder = self.env['mrp.workorder'].search(
|
||||
# [('surface_technics_parameters_id', '!=', False), ('production_id', '=', production.id),
|
||||
# ('is_subcontract', '=', True), ('state', '!=', 'cancel')], order='sequence asc')
|
||||
# need_delete_workorder = process_parameter_workorder - special_design_workorder
|
||||
# for workorder in need_delete_workorder:
|
||||
# workorder._get_surface_technics_purchase_ids().write({'active': False})
|
||||
# workorder.move_subcontract_workorder_ids.write({'state': 'cancel'})
|
||||
# workorder.move_subcontract_workorder_ids.picking_id.write({'active': False})
|
||||
|
||||
if special_design_workorder:
|
||||
consecutive_workorders = []
|
||||
sorted_workorders = sorted(process_parameter_workorder, key=lambda w: w.sequence)
|
||||
sorted_workorders = sorted(special_design_workorder, key=lambda w: w.sequence)
|
||||
# for i, workorder in enumerate(sorted_workorders):
|
||||
# # 检查当前工作订单和下一个工作订单是否连续,并且供应商相同
|
||||
# if i == 0:
|
||||
|
||||
@@ -57,6 +57,7 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
# td_upd = self.env['sf.technology.design'].sudo().search(domain)
|
||||
# if td_upd:
|
||||
# ro.write({'sequence': td_upd.sequence, 'active': td_upd.active})
|
||||
# 特殊表面工艺
|
||||
special_design = self.env['sf.technology.design'].sudo().search(
|
||||
[('routing_tag', '=', 'special'), ('production_id', '=', production.id),
|
||||
('is_auto', '=', False), ('active', 'in', [True, False])])
|
||||
@@ -112,7 +113,9 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
workorder.blocked_by_workorder_ids = blocked_by_workorder_ids[0]
|
||||
productions._create_workorder(False)
|
||||
if self.production_id.product_id.categ_id.type == '成品':
|
||||
productions.get_subcontract_pick_purchase()
|
||||
special_design_workorder = self.env['mrp.workorder'].search(
|
||||
[('technology_design_id', 'in', special_design.ids), ('production_id', '=', special.production_id.id), ('state', '!=', 'cancel')])
|
||||
productions.get_subcontract_pick_purchase(special_design_workorder)
|
||||
productions.is_adjust = False
|
||||
for item in productions:
|
||||
workorder = item.workorder_ids.filtered(lambda wo: wo.state not in ('cancel')).sorted(
|
||||
|
||||
@@ -363,7 +363,6 @@ class RePurchaseOrder(models.Model):
|
||||
server_product_process = []
|
||||
purchase_order = pp._get_surface_technics_purchase_ids()
|
||||
if purchase_order:
|
||||
purchase_order.write({'state': 'draft'})
|
||||
pp.purchase_id = [(6, 0, [purchase_order.id])]
|
||||
else:
|
||||
server_template = self.env['product.template'].search(
|
||||
@@ -374,12 +373,16 @@ class RePurchaseOrder(models.Model):
|
||||
'product_qty': 1,
|
||||
'product_uom': server_template.uom_id.id
|
||||
}))
|
||||
# 获取服务商品最后一个供应商的采购员
|
||||
purchase_user_id = server_template.seller_ids[-1].partner_id.purchase_user_id
|
||||
purchase_order = self.env['purchase.order'].sudo().create({
|
||||
'partner_id': server_template.seller_ids[0].partner_id.id,
|
||||
'origin': production.name,
|
||||
'state': 'draft',
|
||||
'purchase_type': 'consignment',
|
||||
'order_line': server_product_process})
|
||||
'order_line': server_product_process,
|
||||
'user_id': purchase_user_id.id
|
||||
})
|
||||
pp.purchase_id = [(6, 0, [purchase_order.id])]
|
||||
# self.env.cr.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user