Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/功能刀具优化
This commit is contained in:
@@ -159,20 +159,22 @@ td.o_required_modifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.o_list_view .o_list_table thead {
|
.o_list_view .o_list_table thead {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
//z-index: 100000;
|
z-index: 100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//.o_list_view .o_list_table {
|
//.o_list_view .o_list_table {
|
||||||
// height: 1799px !important;
|
// height: 1799px !important;
|
||||||
//}
|
//}
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
overflow: unset;
|
overflow: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
|
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
|
||||||
position: sticky !important;
|
position: sticky !important;
|
||||||
top: 0;
|
top: 0;
|
||||||
//z-index: 100000;
|
z-index: 100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
@@ -253,6 +255,36 @@ div[class="o_content o_component_with_search_panel"] .show_state span {
|
|||||||
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 55px;
|
top: 55px;
|
||||||
right: 263px;
|
right: 43.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1200px) {
|
||||||
|
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||||
|
right: 52%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||||
|
left: -95px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||||
|
// display: flex !important;
|
||||||
|
// flex-direction: column;
|
||||||
|
//}
|
||||||
|
|
||||||
|
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom>div:nth-child(1)>span:nth-child(1) {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom>div:nth-child(1) {
|
||||||
|
margin-top: -5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-bg-warning {
|
||||||
|
background-color: #FED300 !important;
|
||||||
|
}
|
||||||
@@ -127,19 +127,6 @@ class MrsProcessingOrder(models.Model):
|
|||||||
index=True, string='加工工艺')
|
index=True, string='加工工艺')
|
||||||
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||||
|
|
||||||
|
|
||||||
# class Tray(models.Model):
|
|
||||||
# _name = 'sf.tray'
|
|
||||||
# _description = '托盘'
|
|
||||||
#
|
|
||||||
# code = fields.Char('编码', copy=False)
|
|
||||||
# name = fields.Char('名称')
|
|
||||||
# state = fields.Selection(
|
|
||||||
# [("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
|
||||||
# default="空闲", string="状态")
|
|
||||||
# active = fields.Boolean('有效', default=True)
|
|
||||||
|
|
||||||
|
|
||||||
class SupplierSort(models.Model):
|
class SupplierSort(models.Model):
|
||||||
_name = 'sf.supplier.sort'
|
_name = 'sf.supplier.sort'
|
||||||
_description = '供应商排序'
|
_description = '供应商排序'
|
||||||
|
|||||||
@@ -361,26 +361,5 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<!-- <record model="ir.ui.view" id="sf_tray_form">-->
|
|
||||||
<!-- <field name="name">sf.tray.form</field>-->
|
|
||||||
<!-- <field name="model">sf.tray</field>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!-- <form string="托盘">-->
|
|
||||||
<!-- <header>-->
|
|
||||||
<!-- <field name='state' widget="radio" options="{'horizontal': True}"/>-->
|
|
||||||
<!-- </header>-->
|
|
||||||
<!-- <sheet>-->
|
|
||||||
<!-- <group name="group1">-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="code" required="1"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name="name" required="1"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- </sheet>-->
|
|
||||||
<!-- </form>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -14,7 +14,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
|||||||
_inherit = 'maintenance.equipment.category'
|
_inherit = 'maintenance.equipment.category'
|
||||||
_description = '设备类别'
|
_description = '设备类别'
|
||||||
|
|
||||||
equipment_type = fields.Selection([('机床', '机床')], string='类型', default='机床')
|
equipment_type = fields.Selection([('机床', '机床'), ('机械臂', '机械臂'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')], string='类型', default='机床')
|
||||||
|
|
||||||
|
|
||||||
class SfMaintenanceEquipment(models.Model):
|
class SfMaintenanceEquipment(models.Model):
|
||||||
|
|||||||
@@ -332,7 +332,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div class="o_kanban_record_bottom state_zc">
|
<div class="o_kanban_record_bottom state_zc">
|
||||||
<field name="state_zc"/>
|
<div>
|
||||||
|
<field name="brand_id"/>
|
||||||
|
<field name="type_id"/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<field name="state_zc"
|
||||||
|
widget="label_selection"
|
||||||
|
options="{'classes': {'未注册': 'warning', '已注册': 'success'}}"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="o_kanban_record_bottom state_zc">
|
<div class="o_kanban_record_bottom state_zc">
|
||||||
<field name="technician_user_id"/>
|
<field name="technician_user_id"/>
|
||||||
@@ -349,7 +357,7 @@
|
|||||||
<div t-attf-class="#{record.state.raw_value == '故障' ? 'color_2' : ''}"></div>
|
<div t-attf-class="#{record.state.raw_value == '故障' ? 'color_2' : ''}"></div>
|
||||||
<div t-attf-class="#{record.state.raw_value == '不可用' ? 'color_3' : ''}"></div>
|
<div t-attf-class="#{record.state.raw_value == '不可用' ? 'color_3' : ''}"></div>
|
||||||
<p class="o_kanban_record_bottom state_zc"
|
<p class="o_kanban_record_bottom state_zc"
|
||||||
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
||||||
#{record.state.raw_value == '故障' ? 'font_color_2' : ''}
|
#{record.state.raw_value == '故障' ? 'font_color_2' : ''}
|
||||||
#{record.state.raw_value == '不可用' ? 'font_color_3' : ''}">
|
#{record.state.raw_value == '不可用' ? 'font_color_3' : ''}">
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
|
|||||||
@@ -16,14 +16,12 @@
|
|||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/mrp_production_addional_change.xml',
|
'views/mrp_production_addional_change.xml',
|
||||||
# 'report/tray_report.xml',
|
|
||||||
# 'views/mrp_maintenance_views.xml',
|
# 'views/mrp_maintenance_views.xml',
|
||||||
'views/mrp_routing_workcenter_view.xml',
|
'views/mrp_routing_workcenter_view.xml',
|
||||||
'views/mrp_workcenter_views.xml',
|
'views/mrp_workcenter_views.xml',
|
||||||
'views/mrp_workorder_view.xml',
|
'views/mrp_workorder_view.xml',
|
||||||
'views/production_line_view.xml',
|
'views/production_line_view.xml',
|
||||||
'views/tool_other_features_view.xml',
|
'views/tool_other_features_view.xml',
|
||||||
# 'views/tray_view.xml',
|
|
||||||
'views/model_type_view.xml',
|
'views/model_type_view.xml',
|
||||||
# 'views/kanban_change.xml'
|
# 'views/kanban_change.xml'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from . import tray
|
|
||||||
from . import model_type
|
from . import model_type
|
||||||
from . import product_template
|
from . import product_template
|
||||||
from . import mrp_production
|
from . import mrp_production
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
# # -*- coding: utf-8 -*-
|
|
||||||
# # Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
|
||||||
# import base64
|
|
||||||
# from io import BytesIO
|
|
||||||
# from odoo import api, fields, models
|
|
||||||
# #from pystrich.code128 import Code128Encoder
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# class Tray(models.Model):
|
|
||||||
# _inherit = 'sf.tray'
|
|
||||||
# _description = '托盘'
|
|
||||||
# qr_image = fields.Binary(string="托盘二维码", compute='compute_qr_image')
|
|
||||||
# production_id = fields.Many2one('mrp.production', string='制造订单',
|
|
||||||
# related='workorder_id.production_id'
|
|
||||||
# )
|
|
||||||
# workorder_id = fields.Many2one('mrp.workorder', string="工单"
|
|
||||||
# )
|
|
||||||
#
|
|
||||||
# @api.onchange('production_id')
|
|
||||||
# def updateTrayState(self):
|
|
||||||
# if self.workorder_id != False and self.create_date != False:
|
|
||||||
#
|
|
||||||
# self.state = '占用'
|
|
||||||
# else:
|
|
||||||
# self.state = '空闲'
|
|
||||||
#
|
|
||||||
# #解绑托盘
|
|
||||||
# def unclamp(self):
|
|
||||||
# self.workorder_id = False
|
|
||||||
# self.production_id = False
|
|
||||||
# self.state = '空闲'
|
|
||||||
#
|
|
||||||
# @api.depends('code')
|
|
||||||
# def compute_qr_image(self):
|
|
||||||
# for item in self:
|
|
||||||
# if not item.code:
|
|
||||||
# item.qr_image = False
|
|
||||||
# continue
|
|
||||||
# # 根据code动态生成二维码图片
|
|
||||||
# # qr = qrcode.QRCode(
|
|
||||||
# # version=1,
|
|
||||||
# # error_correction=qrcode.constants.ERROR_CORRECT_L,
|
|
||||||
# # box_size=10,
|
|
||||||
# # border=4,
|
|
||||||
# # )
|
|
||||||
# # qr.add_data(item.code)
|
|
||||||
# # qr.make(fit=True)
|
|
||||||
# # img = qr.make_image()
|
|
||||||
# # 生成条形码文件
|
|
||||||
# # bar = barcode.get("ean13", "123456789102", writer=ImageWriter())
|
|
||||||
# # a = bar.get_fullcode()
|
|
||||||
# # b = bar.save('occ')
|
|
||||||
# # 生成条形码图片
|
|
||||||
# partner_encoder = Code128Encoder(item.code)
|
|
||||||
# # 转换bytes流
|
|
||||||
# temp = BytesIO()
|
|
||||||
# partner_encoder.save(temp)
|
|
||||||
# # img.save(temp, format='PNG')
|
|
||||||
# qr_image = base64.b64encode(temp.getvalue())
|
|
||||||
# item.qr_image = qr_image
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!-- 托盘码打印尺寸-->
|
|
||||||
<record id="sf_tray1" model="report.paperformat">
|
|
||||||
<field name="name">Dymo Label Sheet</field>
|
|
||||||
<field name="default" eval="True"/>
|
|
||||||
<field name="format">custom</field>
|
|
||||||
<field name="page_height">100</field>
|
|
||||||
<field name="page_width">60</field>
|
|
||||||
<field name="orientation">Landscape</field>
|
|
||||||
<field name="margin_top">0</field>
|
|
||||||
<field name="margin_bottom">0</field>
|
|
||||||
<field name="margin_left">0</field>
|
|
||||||
<field name="margin_right">0</field>
|
|
||||||
<field name="disable_shrinking" eval="True"/>
|
|
||||||
<field name="dpi">96</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- 托盘码打印动作-->
|
|
||||||
<record id="label_sf_tray_code" model="ir.actions.report">
|
|
||||||
<field name="name">打印条形码</field>
|
|
||||||
<field name="model">sf.tray</field>
|
|
||||||
<field name="report_type">qweb-pdf</field>
|
|
||||||
<field name="report_name">sf_manufacturing.sf_tray_template</field>
|
|
||||||
<field name="report_file">sf_manufacturing.sf_tray_template</field>
|
|
||||||
<field name="binding_model_id" ref="model_sf_tray"/>
|
|
||||||
<field name="binding_type">report</field>
|
|
||||||
<field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>
|
|
||||||
|
|
||||||
</record>
|
|
||||||
<!-- 托盘码打印模板-->
|
|
||||||
<template id="sf_tray_template">
|
|
||||||
<t t-call="web.html_container">
|
|
||||||
<t t-call="web.external_layout">
|
|
||||||
<t t-foreach="docs" t-as="o">
|
|
||||||
<div class="page">
|
|
||||||
<div t-field="o.code"
|
|
||||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
|
||||||
<div t-field="o.code" style="text-align: center"/>
|
|
||||||
</div>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- 产品信息打印动作-->
|
|
||||||
<record id="label_sf_tray_code1" model="ir.actions.report">
|
|
||||||
<field name="name">打印产品信息</field>
|
|
||||||
<field name="model">mrp.workorder</field>
|
|
||||||
<field name="report_type">qweb-pdf</field>
|
|
||||||
<field name="report_name">sf_manufacturing.sf_tray_template1</field>
|
|
||||||
<field name="report_file">sf_manufacturing.sf_tray_template1</field>
|
|
||||||
<field name="binding_model_id" ref="model_mrp_workorder"/>
|
|
||||||
<field name="binding_type">report</field>
|
|
||||||
<field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<!-- 产品信息打印模板-->
|
|
||||||
<template id="sf_tray_template1">
|
|
||||||
<t t-call="web.html_container">
|
|
||||||
<t t-call="web.external_layout">
|
|
||||||
<t t-foreach="docs" t-as="o">
|
|
||||||
<div class="page">
|
|
||||||
<div t-field="o.production_id.name"
|
|
||||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
|
||||||
<div t-field="o.production_id" style="text-align: center"/>
|
|
||||||
</div>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
</template>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@@ -28,6 +28,9 @@
|
|||||||
<xpath expr="//field[@name='production_real_duration']" position="after">
|
<xpath expr="//field[@name='production_real_duration']" position="after">
|
||||||
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
|
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='state']" position="before">
|
||||||
|
<field name="schedule_state" optional="show"/>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//field[@name='activity_ids']" position="replace">
|
<xpath expr="//field[@name='activity_ids']" position="replace">
|
||||||
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
|
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
<!--<?xml version="1.0" encoding="utf-8"?>-->
|
|
||||||
<!--<odoo>-->
|
|
||||||
<!-- <data>-->
|
|
||||||
<!-- <record id="sf_tray_form_inherit" model="ir.ui.view">-->
|
|
||||||
<!-- <field name="name">托盘条形码生成</field>-->
|
|
||||||
<!-- <field name="model">sf.tray</field>-->
|
|
||||||
<!-- <field name="inherit_id" ref="sf_base.sf_tray_form"/>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!-- <xpath expr="//group[@name='group1']" position="after">-->
|
|
||||||
<!-- <notebook>-->
|
|
||||||
<!-- <page string="生成条形码">-->
|
|
||||||
<!-- <field name='qr_image' widget="image"/>-->
|
|
||||||
<!-- <group>-->
|
|
||||||
<!-- <field name='production_id' readonly="1"-->
|
|
||||||
<!-- attrs='{"invisible": [("production_id","=",False)]}'/>-->
|
|
||||||
<!-- <field name="workorder_id"/>-->
|
|
||||||
<!-- </group>-->
|
|
||||||
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
|
||||||
<!-- <button type="object" class="oe_highlight" name="unclamp" string="解除装夹"-->
|
|
||||||
<!-- attrs='{"invisible": [("state","=","空闲")]}'/>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<!-- </page>-->
|
|
||||||
|
|
||||||
<!-- </notebook>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
<!-- </data>-->
|
|
||||||
<!--</odoo>-->
|
|
||||||
@@ -180,9 +180,11 @@ class sf_production_plan(models.Model):
|
|||||||
print(workorder_time)
|
print(workorder_time)
|
||||||
self.date_planned_finished = self.date_planned_start + timedelta(minutes=workorder_time)
|
self.date_planned_finished = self.date_planned_start + timedelta(minutes=workorder_time)
|
||||||
self.state = 'done'
|
self.state = 'done'
|
||||||
|
aa.schedule_state = '已排'
|
||||||
else:
|
else:
|
||||||
self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
raise ValidationError("未找到工单")
|
||||||
self.state = 'done'
|
# self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
||||||
|
# self.state = 'done'
|
||||||
return {
|
return {
|
||||||
'name': '排程甘特图',
|
'name': '排程甘特图',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
@@ -224,6 +226,8 @@ class sf_production_plan(models.Model):
|
|||||||
def cancel_production_schedule(self):
|
def cancel_production_schedule(self):
|
||||||
self.date_planned_finished = False
|
self.date_planned_finished = False
|
||||||
self.state = 'draft'
|
self.state = 'draft'
|
||||||
|
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
||||||
|
aa.schedule_state = '未排'
|
||||||
return self.date_planned_finished
|
return self.date_planned_finished
|
||||||
|
|
||||||
def liucheng_cs(self):
|
def liucheng_cs(self):
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<form string="订单计划">
|
<form string="订单计划">
|
||||||
<header>
|
<header>
|
||||||
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
||||||
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"/>
|
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'/>
|
||||||
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
|
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
|
||||||
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
||||||
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user