From 0ef13504e7cfb57f748da51a9f98383de38ddc08 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Mon, 22 Jan 2024 17:33:40 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A7=E6=9E=B6?= =?UTF-8?q?=E8=B4=A7=E4=BD=8D=E5=85=B3=E8=81=94=E7=A7=BB=E5=8A=A8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=B0=83=E6=8B=A8=E5=8D=95=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 +- sf_sale/models/auto_quatotion_common.py | 2 +- sf_sale/models/quick_easy_order.py | 4 +- sf_warehouse/models/model.py | 20 +++++- .../views/change_stock_move_views.xml | 22 +++++- sf_warehouse/views/shelf_location.xml | 69 +++++++++++++++++-- 6 files changed, 107 insertions(+), 14 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 42a392e2..cac61045 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -6,8 +6,8 @@ import os from odoo import models, fields, api, _ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +#from OCC.Extend.DataExchange import read_step_file +#from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py index 09ea3f0f..1b29c6d2 100644 --- a/sf_sale/models/auto_quatotion_common.py +++ b/sf_sale/models/auto_quatotion_common.py @@ -2,7 +2,7 @@ import logging from odoo.modules import get_resource_path from odoo import fields, models, api -from quatotion import readSql, feature_recognize, auto_quatotion +#from quatotion import readSql, feature_recognize, auto_quatotion __author__ = 'jinling.yang' _logger = logging.getLogger(__name__) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 1e5f274c..5ec1fd52 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -5,8 +5,8 @@ import os import json from datetime import datetime import requests -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +#from OCC.Extend.DataExchange import read_step_file +#from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index d03789cd..a53dae86 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import datetime import logging from odoo import api, fields, models from odoo.osv import expression @@ -223,6 +224,23 @@ class ShelfLocation(models.Model): _description = '货架货位' _order = 'name' + # current_location_id = fields.Many2one('sf.shelf.location', string='当前位置') + # # 目的位置 + # destination_location_id = fields.Many2one('sf.shelf.location', string='目的位置') + current_move_ids = fields.One2many('stock.move.line', 'current_location_id', '当前位置调拨单') + destination_move_ids = fields.One2many('stock.move.line', 'destination_location_id', '目标位置调拨单') + storage_time = fields.Datetime('入库时间', compute='_compute_location_status') + + @api.depends('location_status') + def _compute_location_status(self): + for record in self: + if record.location_status == '占用': + record.storage_time = datetime.datetime.now() + if record.location_status == '空闲': + record.storage_time = False + else: + pass + name = fields.Char('名称', required=True, size=20) barcode = fields.Char('编码', copy=False, size=15) @@ -452,7 +470,7 @@ class SfStockPicking(models.Model): if line: if line.current_location_id: line.current_location_id.product_sn_id = False - line.current_location_id = False + line.current_location_id.location_status = '空闲' return res diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml index c53fc1bb..5b8c8c06 100644 --- a/sf_warehouse/views/change_stock_move_views.xml +++ b/sf_warehouse/views/change_stock_move_views.xml @@ -7,7 +7,7 @@ - + + sf.stock.move.line.tree + stock.move.line + + + + + + + + + + + + + + + sf.stock.move.line.form stock.move.line - + diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml index 7ac4dcbc..f19a6421 100644 --- a/sf_warehouse/views/shelf_location.xml +++ b/sf_warehouse/views/shelf_location.xml @@ -9,26 +9,82 @@ - - - - - - + + + + + + + + + + + sf.view.picking.form + stock.move.line + + + + + + + + + + + 移动历史 + stock.move.line + ir.actions.act_window + tree,form + + + +

+ 产品移动历史 +

+
+
+ Shelf Location form sf.shelf.location
+
+
+ + +
@@ -55,6 +111,7 @@ +
From e661297b5d1b227dc53ba6e06a18ef14be150e41 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 24 Jan 2024 15:59:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=80=BB=E7=9B=91=E5=AE=A1=E6=A0=B8=E8=8F=9C=E5=8D=95=E5=8D=95?= =?UTF-8?q?-=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=8D=E5=BA=94-=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=B2=A1=E6=9C=89=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/views/purchase_order_view.xml | 6 ++---- sf_sale/views/sale_order_view.xml | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index 423742b8..c1794277 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -10,22 +10,20 @@ - - + @@ -63,15 +71,18 @@ attrs="{'invisible': [('equipment_type', '!=', '机床')]}"> - +