diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss
index 3868fb09..8495e5cd 100644
--- a/sf_base/static/src/scss/test.scss
+++ b/sf_base/static/src/scss/test.scss
@@ -121,20 +121,12 @@ td.o_required_modifier {
//font-weight: bold;
}
-.o_list_table th > div > i {
- display: none !important;
+.text-truncate {
+ overflow: unset !important;
+ text-overflow: unset !important;
+ white-space: unset !important;
}
-body .o_list_table th:nth-child(4) {
- width: 100px !important;
+.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) {
+ white-space: nowrap !important;
}
-
-//body .o_list_table th:nth-child(5) {
-// width: 500px !important;
-//}
-
-.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove).o_list_text {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
-}
\ No newline at end of file
diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml
index 5c3fd3ad..8c8e1632 100644
--- a/sf_base/views/base_view.xml
+++ b/sf_base/views/base_view.xml
@@ -159,11 +159,11 @@
-
+
-
+
@@ -210,27 +210,28 @@
-
+
-
+
+
-
+
Φ
-
+
Φ
diff --git a/sf_base/views/common_view.xml b/sf_base/views/common_view.xml
index aab5cf1f..f0ff3a07 100644
--- a/sf_base/views/common_view.xml
+++ b/sf_base/views/common_view.xml
@@ -350,7 +350,7 @@
加工工艺
ir.actions.act_window
sf.processing.technology
- tree,form
+ tree
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 739af005..86fc9dd5 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -135,7 +135,6 @@ class ResMrpWorkOrder(models.Model):
self.functional_fixture_code = self.functional_fixture_id.code
self.functional_fixture_type_id = self.functional_fixture_id.type_id.id
-
def get_no_data(self, production_id):
process_parameter_workorder = self.search(
[('surface_technics_parameters_id', '!=', False), ('production_id', '=', production_id)])
@@ -338,19 +337,19 @@ class ResMrpWorkOrder(models.Model):
# tray.unclamp()
# self.tray_id = False
- # return {
- # 'name': _('New Maintenance Request'),
- # 'view_mode': 'form',
- # 'res_model': 'maintenance.request',
- # 'res_id':self.id,
- # 'type': 'ir.actions.act_window',
- # 'context': {
- # 'default_company_id': self.company_id.id,
- # 'default_production_id': self.id,
- # },
- # 'domain': [('production_id', '=', self.id)],
- # 'target':'new'
- # }
+ # return {
+ # 'name': _('New Maintenance Request'),
+ # 'view_mode': 'form',
+ # 'res_model': 'maintenance.request',
+ # 'res_id':self.id,
+ # 'type': 'ir.actions.act_window',
+ # 'context': {
+ # 'default_company_id': self.company_id.id,
+ # 'default_production_id': self.id,
+ # },
+ # 'domain': [('production_id', '=', self.id)],
+ # 'target':'new'
+ # }
def recreateManufacturingOrWorkerOrder(self):
"""
@@ -400,20 +399,6 @@ class ResMrpWorkOrder(models.Model):
try:
cnc = self.env['mrp.workorder'].search(
[('routing_type', '=', 'CNC加工'), ('production_id', '=', self.production_id.id)], limit=1)
- logging.info('fetchCNC-cnc:%s' % cnc)
- # if cnc.product_id.upload_model_file:
- # logging.info('fetchCNC-upload_model_file:%s' % cnc.product_id.upload_model_file)
- # attachments = cnc.product_id.upload_model_file[0]
- # logging.info('fetchCNC-attachment1:%s' % attachments)
- # logging.info('fetchCNC-attachment1:%s' % cnc.product_id.upload_model_file[0])
- # logging.info('fetchCNC-attachment2:%s' % cnc.product_id.upload_model_file[0].datas)
- # logging.info('fetchCNC-attachment:%s' % attachments.datas)
- # base64_data = base64.b64encode(attachments.datas)
- # logging.info('fetchCNC-attachment1:%s' % attachments)
- # base64_datas = base64_data.decode('utf-8')
- # model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
- # logging.info('fetchCNC-model_code:%s' % model_code)
- logging.info('fetchCNC-model_code1:%s' % cnc.product_id.model_code)
res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code,
'production_no': self.production_id.name,
'machine_tool_code': cnc.workcenter_id.machine_tool_id.code,
@@ -427,6 +412,7 @@ class ResMrpWorkOrder(models.Model):
'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height,
'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width,
'order_no': cnc.production_id.origin,
+ 'model_order_no': cnc.product_id.default_code.rsplit('-', 1)[0],
'user': self.env.user.name,
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
cnc.product_id.model_file).decode('utf-8')
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 8b95c5af..c29abbf4 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -472,3 +472,22 @@ class ReStockMove(models.Model):
item.product_id.write({'register_state': '注册失败'})
except Exception as e:
raise UserError("注册刀具到云端失败,请联系管理员!")
+
+
+class ReStockQuant(models.Model):
+ _inherit = 'stock.quant'
+
+ def action_apply_inventory(self):
+ inventory_diff_quantity = self.inventory_diff_quantity
+ super(ReStockQuant, self).action_apply_inventory()
+ if inventory_diff_quantity >= 1:
+ stock = self.env['stock.move'].search([('product_id', '=', self.product_id.id), ('is_inventory', '=', True),
+ ('reference', '=', '更新的产品数量'), ('state', '=', 'done')],
+ limit=1, order='id desc')
+ if self.product_id.categ_type == '夹具':
+ stock._register_fixture()
+ elif self.product_id.categ_type == '刀具':
+ stock._register_cutting_tool()
+ return True
+
+
diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py
index fac229f5..eed2be57 100644
--- a/sf_sale/models/quick_easy_order.py
+++ b/sf_sale/models/quick_easy_order.py
@@ -37,11 +37,11 @@ class QuickEasyOrder(models.Model):
quantity = fields.Integer('数量', default=1)
unit_price = fields.Float('单价')
price = fields.Float('总价')
- model_file = fields.Binary('模型文件')
- upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='模型文件')
+ model_file = fields.Binary('glb模型文件')
+ upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='上传模型文件')
delivery_time = fields.Date('交货日期')
customer_id = fields.Many2one('res.partner', string='客户', default=lambda self: self.env.user.partner_id.id)
- state = fields.Selection([('草稿', '草稿'), ('待付款', '待付款'), ('待派单', '待派单'),
+ state = fields.Selection([('草稿', '草稿'), ('待派单', '待派单'),
('待接单', '待接单'), ('加工中', '加工中'),
('物流中', '物流中'), ('已交付', '已交付')], string='订单状态', default='草稿',
readonly=True)
@@ -82,6 +82,7 @@ class QuickEasyOrder(models.Model):
obj = super(QuickEasyOrder, self).create(vals)
self.model_coloring(obj)
self.distribute_to_factory(obj)
+ obj.state = '待接单'
return obj
# 将attach的datas内容转为glb文件
diff --git a/sf_sale/views/quick_easy_order_view.xml b/sf_sale/views/quick_easy_order_view.xml
index cf8a2c9f..a5ce9da2 100644
--- a/sf_sale/views/quick_easy_order_view.xml
+++ b/sf_sale/views/quick_easy_order_view.xml
@@ -6,6 +6,7 @@
quick.easy.order
FP-%(year)s-%(month)s%(day)s-
4
+
# ---------- 快速订单 ------------
@@ -15,13 +16,16 @@
quick.easy.order
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -32,6 +36,9 @@
quick.easy.order