From fee3572f3800d616ce09b57fa2d718a4734b7ede Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Thu, 23 Nov 2023 22:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_bf_connect/models/process_status.py | 13 ++++----- sf_manufacturing/models/stock.py | 28 +++++++++---------- .../static/src/js/kanban_change.js | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index 3a579920..f7b7dccd 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -3,7 +3,6 @@ import logging import requests from odoo import fields, models - _logger = logging.getLogger(__name__) @@ -203,12 +202,12 @@ class FinishStatusChange(models.Model): [('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id), ('usage', '!=', 'supplier')]) if self.env['stock.move'].search([ - ('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']), - ('product_qty', '>', 0), - ('location_id', 'in', wh_location_ids), - ('move_orig_ids', '=', False), - ('picking_id', 'not in', self.ids), - ('product_id', 'in', lines.product_id.ids)], limit=1): + ('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']), + ('product_qty', '>', 0), + ('location_id', 'in', wh_location_ids), + ('move_orig_ids', '=', False), + ('picking_id', 'not in', self.ids), + ('product_id', 'in', lines.product_id.ids)], limit=1): action = self.action_view_reception_report() action['context'] = {'default_picking_ids': self.ids} return action diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index baae91e1..98e98863 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -5,7 +5,7 @@ import logging import json from re import split as regex_split from re import findall as regex_findall -from datetime import datetime, timedelta +from datetime import datetime import requests from odoo import SUPERUSER_ID, _, api, fields, models from odoo.tools import float_compare @@ -148,7 +148,8 @@ class StockRule(models.Model): raise ProcurementException(errors) for company_id, productions_values in productions_values_by_company.items(): - # create the MO as SUPERUSER because the current user may not have the rights to do it (mto product launched by a sale for example) + # create the MO as SUPERUSER because the current user may not have the rights to do it + # (mto product launched by a sale for example) '''创建制造订单''' productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create( productions_values) @@ -198,18 +199,17 @@ class StockRule(models.Model): sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)]) if sale_order: - bb = sale_order.deadline_of_delivery - productions = self.env['sf.production.plan'].sudo().with_company(company_id). \ - create({ - 'name': production.name, - 'order_deadline': sale_order.deadline_of_delivery, - 'production_id': production.id, - 'date_planned_start': production.date_planned_start, - 'origin': production.origin, - 'product_qty': production.product_qty, - 'product_id': production.product_id.id, - 'state': 'draft', - }) + self.env['sf.production.plan'].sudo().with_company(company_id). \ + create({ + 'name': production.name, + 'order_deadline': sale_order.deadline_of_delivery, + 'production_id': production.id, + 'date_planned_start': production.date_planned_start, + 'origin': production.origin, + 'product_qty': production.product_qty, + 'product_id': production.product_id.id, + 'state': 'draft', + }) return True diff --git a/sf_manufacturing/static/src/js/kanban_change.js b/sf_manufacturing/static/src/js/kanban_change.js index 72e7abbe..7e425e3b 100644 --- a/sf_manufacturing/static/src/js/kanban_change.js +++ b/sf_manufacturing/static/src/js/kanban_change.js @@ -38,7 +38,7 @@ class CustomKanbanController extends KanbanController { const button = ev.currentTarget; const id = button.getAttribute('data-id'); - console.log('true_id', id); + // console.log('true_id', id); // const context = {production_line_show: 'shengchanxian1'} this.env.services.rpc('/web/dataset/call_kw', { model: 'mrp.workcenter',