-
-
-
-
+
+
+
+
+
+
+
+
+
+
![Product]()
+
+
+
+
+
+ 规格:
+
+
+
[]
+
+
+
+
+ Variants
-
-
-
-
- 规格:
-
-
[]
-
-
- Variants
-
-
-
-
-
-
-
+
+
+
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index 757922e8..62d1ccd4 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -117,12 +117,15 @@
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
+
+
@@ -234,11 +237,12 @@
-
-
-
-
-
+
+
+
+
+
+
@@ -395,10 +399,23 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -496,11 +513,11 @@
- 工件配送单列表
+ 工件配送
sf.workpiece.delivery
-
-
+
+
@@ -514,11 +531,11 @@
- 工件配送单列表
+ 工件配送
sf.workpiece.delivery
-
-
+
+
@@ -536,7 +553,7 @@
- 工件配送单列表
+ 工件配送
sf.workpiece.delivery
tree,search
diff --git a/sf_manufacturing/views/stock_picking_view.xml b/sf_manufacturing/views/stock_picking_view.xml
index a287fbec..13bb12c2 100644
--- a/sf_manufacturing/views/stock_picking_view.xml
+++ b/sf_manufacturing/views/stock_picking_view.xml
@@ -1,6 +1,17 @@
+
+ stock.move.operations.form.inherit.sf
+ stock.move
+
+
+
+
+
+
+
+
stock.picking.form.inherit.sf
stock.picking
diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py
index 1944f82a..cc82cbe1 100644
--- a/sf_plan/models/custom_plan.py
+++ b/sf_plan/models/custom_plan.py
@@ -67,6 +67,12 @@ class sf_production_plan(models.Model):
sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True)
current_operation_name = fields.Char(string='当前工序名称', size=64, default='生产计划')
+ @api.onchange('production_line_id')
+ def _compute_production_line_id(self):
+ for item in self:
+ item.production_id.production_line_id = item.production_line_id.id
+ item.production_id.plan_start_processing_time = item.date_planned_start
+
@api.onchange('state')
def _onchange_state(self):
if self.state == 'finished':
@@ -324,33 +330,6 @@ class sf_production_plan(models.Model):
raise UserError(e)
-# # sf生产排程
-# class sf_produce_plan(models.Model):
-# _name = 'sf.produce.plan'
-# _description = 'sf生产排程'
-
-# # 重写create方法,使得创建坯料预制排程时,如果给出了计划结束时间,则计划开始时间为计划结束时间减去坯料预制时间
-# @api.model
-# def create(self, vals):
-# # 评估结束时间
-# vals['plan_end_time'] = self._get_plan_end_time(vals['plan_start_time'], vals['quantity'])
-# return super(sf_pl_plan, self).create(vals)
-
-# # 当不设置计划结束时间时,增加计算计划结束时间的方法
-# @api.onchange('plan_start_time', 'quantity')
-# def _onchange_plan_start_time(self):
-# if self.plan_start_time and self.quantity:
-# self.plan_end_time = self._get_plan_end_time(self.plan_start_time, self.quantity)
-#
-# # 计算计划结束时间
-# def _get_plan_end_time(self, plan_start_time, quantity):
-# # 坯料预制时间
-# pl_time = 0.5
-# # 计划结束时间 = 计划开始时间 + 坯料预制时间
-# plan_end_time = plan_start_time + pl_time
-# return plan_end_time
-#
-
# 机台作业计划
class machine_work_schedule(models.Model):
_name = 'sf.machine.schedule'
diff --git a/sf_plan/views/change_manufactuing.xml b/sf_plan/views/change_manufactuing.xml
index d1500bbd..d6d01ce9 100644
--- a/sf_plan/views/change_manufactuing.xml
+++ b/sf_plan/views/change_manufactuing.xml
@@ -10,10 +10,11 @@
-
-
-
-
+
+
+
+
@@ -27,32 +28,33 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
custom.mrp.bom.form
mrp.bom
@@ -62,10 +64,12 @@
@@ -81,10 +85,12 @@
@@ -100,10 +106,12 @@
@@ -119,10 +127,12 @@
@@ -138,10 +148,12 @@
@@ -157,10 +169,12 @@
diff --git a/sf_plan/views/view.xml b/sf_plan/views/view.xml
index 869c3082..dfaa1ca8 100644
--- a/sf_plan/views/view.xml
+++ b/sf_plan/views/view.xml
@@ -5,13 +5,16 @@
sf.production.plan.tree
sf.production.plan
-
+
-
+
@@ -20,8 +23,12 @@
-
-
+
+
@@ -32,14 +39,17 @@
-
+
sf.production.plan.search
sf.production.plan
@@ -151,7 +161,7 @@
default_scale="day"
scales="day,week,month,year"
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
-
+
@@ -191,65 +201,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
sf.machine.schedule.tree
sf.machine.schedule
@@ -268,7 +219,7 @@
gantt,tree,form
-
+
制造订单生产计划
ir.actions.act_window
@@ -284,11 +235,11 @@
groups="sf_base.group_plan_dispatch"
/>
-
-
-
-
-
+
+
+
+
+
制造订单
@@ -305,17 +256,17 @@
-
+
机台作业计划
ir.actions.act_window
sf.machine.schedule
tree
- 暂无机台作业计划
+ 暂无机台作业计划
- 跟进请求的处理,并且和合作者沟通。
+ 跟进请求的处理,并且和合作者沟通。
@@ -330,18 +281,18 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py
index 9fab89e1..26b336d1 100644
--- a/sf_warehouse/models/model.py
+++ b/sf_warehouse/models/model.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
import datetime
import logging
-from odoo import api, fields, models
+from odoo import api, fields, models, _
from odoo.osv import expression
+from odoo.exceptions import UserError
class SfLocation(models.Model):
diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml
index c00779ae..b10eaaa9 100644
--- a/sf_warehouse/views/change_stock_move_views.xml
+++ b/sf_warehouse/views/change_stock_move_views.xml
@@ -15,10 +15,10 @@
('location_id', '=', location_dest_id_value),
('location_status', '=', '空闲')
]"/>
-
-
+
+
-
+
@@ -55,26 +55,37 @@
-
+
sf.view.picking.form
stock.picking
-
+
-
+
-
+
-
+
-
+
@@ -86,7 +97,9 @@
-
+
@@ -97,10 +110,12 @@
-
+
-
+
diff --git a/stock_barcode/models/stock_move_line.py b/stock_barcode/models/stock_move_line.py
index 8c369685..bfbcd221 100644
--- a/stock_barcode/models/stock_move_line.py
+++ b/stock_barcode/models/stock_move_line.py
@@ -13,20 +13,23 @@ class StockMoveLine(models.Model):
picking_location_dest_id = fields.Many2one(related='picking_id.location_dest_id')
product_stock_quant_ids = fields.One2many('stock.quant', compute='_compute_product_stock_quant_ids')
product_packaging_id = fields.Many2one(related='move_id.product_packaging_id')
- product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty', help="Quantity of the Packaging in the UoM of the Stock Move Line.")
+ product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty',
+ help="Quantity of the Packaging in the UoM of the Stock Move Line.")
is_completed = fields.Boolean(compute='_compute_is_completed', help="Check if the quantity done matches the demand")
@api.depends('product_id', 'product_id.stock_quant_ids')
def _compute_product_stock_quant_ids(self):
for line in self:
- line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
+ line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(
+ lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
def _compute_dummy_id(self):
self.dummy_id = ''
def _compute_product_packaging_uom_qty(self):
for sml in self:
- sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(sml.product_packaging_id.qty, sml.product_uom_id)
+ sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(
+ sml.product_packaging_id.qty, sml.product_uom_id)
@api.depends('qty_done')
def _compute_is_completed(self):
diff --git a/stock_barcode/views/stock_move_line_views.xml b/stock_barcode/views/stock_move_line_views.xml
index b311abb6..581bdb38 100644
--- a/stock_barcode/views/stock_move_line_views.xml
+++ b/stock_barcode/views/stock_move_line_views.xml
@@ -1,201 +1,236 @@
+
+ stock.move.line.operations.tree.inherit
+ stock.move.line
+
+
+
+
+
+
+
+
+
+
-
- stock.product.selector
- stock.move.line
- 1000
-
-