Accept Merge Request #1208: (feature/优化制造订单列表 -> 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/1208?initial=true
This commit is contained in:
@@ -815,17 +815,17 @@ class MrpProduction(models.Model):
|
|||||||
def do_update_program(self):
|
def do_update_program(self):
|
||||||
program_production = self
|
program_production = self
|
||||||
if len(program_production) >= 1:
|
if len(program_production) >= 1:
|
||||||
same_product_id = None
|
# same_product_id = None
|
||||||
is_not_same_product = 0
|
# is_not_same_product = 0
|
||||||
for item in program_production:
|
for item in program_production:
|
||||||
if same_product_id is None:
|
# if same_product_id is None:
|
||||||
same_product_id = item.product_id
|
# same_product_id = item.product_id
|
||||||
if item.product_id != same_product_id:
|
# if item.product_id != same_product_id:
|
||||||
is_not_same_product += 1
|
# is_not_same_product += 1
|
||||||
if item.state != "rework" and item.programming_state != "已编程未下发":
|
if item.state != "rework" and item.programming_state != "已编程未下发":
|
||||||
raise UserError("请选择状态为返工且已编程未下发的制造订单")
|
raise UserError("请选择状态为返工且已编程未下发的制造订单")
|
||||||
if is_not_same_product >= 1:
|
# if is_not_same_product >= 1:
|
||||||
raise UserError("您选择的记录中含有其他产品的制造订单,请选择同一产品的制造订单")
|
# raise UserError("您选择的记录中含有其他产品的制造订单,请选择同一产品的制造订单")
|
||||||
grouped_program_ids = {k: list(g) for k, g in groupby(program_production, key=lambda x: x.programming_no)}
|
grouped_program_ids = {k: list(g) for k, g in groupby(program_production, key=lambda x: x.programming_no)}
|
||||||
program_to_production_names = {}
|
program_to_production_names = {}
|
||||||
for programming_no, program_production in grouped_program_ids.items():
|
for programming_no, program_production in grouped_program_ids.items():
|
||||||
|
|||||||
@@ -465,6 +465,8 @@
|
|||||||
<separator/>
|
<separator/>
|
||||||
<filter string="返工且已编程" name="filter_rework_programmed"
|
<filter string="返工且已编程" name="filter_rework_programmed"
|
||||||
domain="[('state', '=', 'rework'),('programming_state', '=', '已编程')]"/>
|
domain="[('state', '=', 'rework'),('programming_state', '=', '已编程')]"/>
|
||||||
|
<filter string="返工且已编程未下发" name="filter_rework_programmed_not_delivered"
|
||||||
|
domain="[('state', '=', 'rework'),('programming_state', '=', '已编程未下发')]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter name="filter_programming" string="编程中"
|
<filter name="filter_programming" string="编程中"
|
||||||
domain="[('programming_state', '=', '编程中')]"/>
|
domain="[('programming_state', '=', '编程中')]"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user