设备类别新增选项
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -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>-->
|
|
||||||
Reference in New Issue
Block a user