优化工单
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of YiZuo. See LICENSE file for full copyright and licensing details.
|
||||
import logging
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
from collections import defaultdict, namedtuple
|
||||
from odoo.addons.stock.models.stock_rule import ProcurementException
|
||||
from datetime import datetime
|
||||
from itertools import groupby
|
||||
from odoo import models, api, fields, _
|
||||
|
||||
|
||||
@@ -22,4 +19,13 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
else:
|
||||
domain = [('id', '=', self.production_id.id)]
|
||||
productions = self.env['mrp.production'].search(domain)
|
||||
productions._create_workorder(self.production_id)
|
||||
for production in productions:
|
||||
special = production.technology_design_ids.filtered(
|
||||
lambda td: td.is_auto is False and td.process_parameters_id is not False)
|
||||
if special:
|
||||
production.get_subcontract_purchase()
|
||||
productions._create_workorder(False)
|
||||
for item in productions:
|
||||
workorder = item.workorder_ids.filtered(lambda wo: wo.state not in ('cancel')).sorted(
|
||||
key=lambda a: a.sequence)
|
||||
workorder[0].state = 'waiting'
|
||||
|
||||
Reference in New Issue
Block a user