Accept Merge Request #1294: (feature/update_production_line -> 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/1294?initial=true
This commit is contained in:
@@ -207,7 +207,8 @@ class ResWorkcenter(models.Model):
|
||||
date_planned_end = date_planned_end.strftime('%Y-%m-%d')
|
||||
plan_ids = self.env['sf.production.plan'].sudo().search([('date_planned_start', '>=', date_planned_start),
|
||||
('date_planned_start', '<',
|
||||
date_planned_end), ('state', '!=', 'draft')])
|
||||
date_planned_end),
|
||||
('state', 'not in', ['draft', 'cancel'])])
|
||||
if plan_ids:
|
||||
sum_qty = sum([p.product_qty for p in plan_ids])
|
||||
if sum_qty >= self.default_capacity:
|
||||
@@ -222,7 +223,8 @@ class ResWorkcenter(models.Model):
|
||||
date_planned_end = date_planned_end.strftime('%Y-%m-%d %H:00:00')
|
||||
plan_ids = self.env['sf.production.plan'].sudo().search([('date_planned_start', '>=', date_planned_start),
|
||||
('date_planned_start', '<',
|
||||
date_planned_end), ('state', '!=', 'draft')])
|
||||
date_planned_end),
|
||||
('state', 'not in', ['draft', 'cancel'])])
|
||||
|
||||
if plan_ids:
|
||||
sum_qty = sum([p.product_qty for p in plan_ids])
|
||||
|
||||
Reference in New Issue
Block a user