设备类别新增选项

This commit is contained in:
qihao.gong@jikimo.com
2023-09-22 17:01:03 +08:00
parent f03b77f9bb
commit 681b769356
8 changed files with 1 additions and 202 deletions

View File

@@ -16,14 +16,12 @@
'security/group_security.xml',
'security/ir.model.access.csv',
'views/mrp_production_addional_change.xml',
# 'report/tray_report.xml',
# 'views/mrp_maintenance_views.xml',
'views/mrp_routing_workcenter_view.xml',
'views/mrp_workcenter_views.xml',
'views/mrp_workorder_view.xml',
'views/production_line_view.xml',
'views/tool_other_features_view.xml',
# 'views/tray_view.xml',
'views/model_type_view.xml',
# 'views/kanban_change.xml'

View File

@@ -1,4 +1,3 @@
from . import tray
from . import model_type
from . import product_template
from . import mrp_production

View File

@@ -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

View File

@@ -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>

View File

@@ -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>-->