去掉警告及开发表面工艺相关需求
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -63,6 +63,8 @@ class MrsProductionProcess(models.Model):
|
||||
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
|
||||
gain_way = fields.Selection([("自加工", "自加工"), ("外协", "外协")], default="", string="获取方式")
|
||||
category_id = fields.Many2one('sf.production.process.category')
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True)
|
||||
|
||||
|
||||
|
||||
class MrsProcessingTechnology(models.Model):
|
||||
|
||||
@@ -15,6 +15,7 @@ access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,base.group_user,1,1,1,1
|
||||
access_sf_production_process_category,sf_production_process_category,model_sf_production_process_category,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -108,55 +108,49 @@
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="表面工艺">
|
||||
<group>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="gain_way" required="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="工序">
|
||||
<field name='processing_order_ids' options="{'no_create':True}" widget="one2many">
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="processing_technology_ids" widget="many2many_tags">
|
||||
</field>
|
||||
</tree>
|
||||
<form>
|
||||
<field name="processing_technology_ids" widget="many2many">
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="可选参数">
|
||||
<field name="parameter_ids">
|
||||
<tree force_save="1">
|
||||
<field name="code" readonly="1" force_save="1"/>
|
||||
<field name="name"/>
|
||||
<field name="price"/>
|
||||
<field name='process_id' default="default" invisible="1"/>
|
||||
</tree>
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="gain_way" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="workcenter_ids" widget="many2many_tags" string="工作中心" required="0"/>
|
||||
</group>
|
||||
|
||||
<notebook>
|
||||
<page string="可选参数">
|
||||
<field name="parameter_ids">
|
||||
<tree force_save="1">
|
||||
<field name="code" readonly="1" force_save="1"/>
|
||||
<field name="name"/>
|
||||
<field name="price"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="适用材料">
|
||||
<field name="materials_model_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
<field name='process_id' default="default" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="工序">
|
||||
<field name='processing_order_ids' options="{'no_create':True}" widget="one2many">
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="processing_technology_ids" widget="many2many_tags">
|
||||
</field>
|
||||
</tree>
|
||||
<form>
|
||||
<field name="processing_technology_ids" widget="many2many">
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -13,13 +13,14 @@
|
||||
'depends': ['sf_base', 'sf_sale', 'sf_dlm'],
|
||||
'data': [
|
||||
'views/res_partner_view.xml',
|
||||
'views/view.xml',
|
||||
# 'views/view.xml',
|
||||
'report/bill_report.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -111,7 +111,6 @@ class Sf_Bf_Connect(http.Controller):
|
||||
product_bom_purchase.with_user(request.env.ref("base.user_admin")).bom_create_line_has(
|
||||
purchase_embryo)
|
||||
order_id.with_user(request.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
||||
order_id.step_file = product.model_file
|
||||
i += 1
|
||||
res['factory_order_no'] = order_id.name
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import cpca
|
||||
#import cpca
|
||||
import logging
|
||||
import base64
|
||||
import requests
|
||||
@@ -37,7 +37,7 @@ class JdEclp(models.Model):
|
||||
deliveryType = fields.Selection([('6', '特快零担'), ('25', '特快重货')], string='运输类型', default='25')
|
||||
# bill = fields.Char(string='物流面单')
|
||||
|
||||
bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
||||
# bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
||||
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
||||
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['mrp', 'base', 'sf_manufacturing', 'web_widget_model_viewer', 'mrp_subcontracting'],
|
||||
'depends': ['mrp', 'base', 'sf_manufacturing', 'web_widget_model_viewer', 'mrp_subcontracting', 'purchase_stock',
|
||||
'uom'],
|
||||
'data': [
|
||||
'data/product_data.xml',
|
||||
'data/uom_data.xml',
|
||||
'views/product_template_view.xml',
|
||||
'views/product_workorder.xml'
|
||||
],
|
||||
@@ -20,6 +22,7 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
<field name="type">原材料</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="product_category_server_sf" model="product.category">-->
|
||||
<!-- <field name="name">服务</field>-->
|
||||
<!-- <field name="type">服务</field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="product_template_sf" model="product.product">
|
||||
<field name="name">CNC加工产品模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
@@ -29,7 +34,7 @@
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="single_manufacturing">true</field>
|
||||
<field name="tracking">serial</field>
|
||||
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
<record id="product_embryo_sf_self_machining" model="product.product">
|
||||
<field name="name">胚料自加工模板</field>
|
||||
@@ -45,6 +50,7 @@
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="single_manufacturing">true</field>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
|
||||
<record id="product_embryo_sf_outsource" model="product.product">
|
||||
@@ -60,6 +66,7 @@
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
<record id="product_embryo_sf_purchase" model="product.product">
|
||||
<field name="name">胚料采购模板</field>
|
||||
@@ -74,6 +81,7 @@
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,8 +1,8 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
import logging
|
||||
import base64
|
||||
import hashlib
|
||||
@@ -30,8 +30,9 @@ class ResProductTemplate(models.Model):
|
||||
product_model_type_id = fields.Many2one('sf.model.type', string='产品模型类型')
|
||||
embryo_model_type_id = fields.Many2one('sf.model.type', string='胚料模型类型')
|
||||
model_processing_panel = fields.Char('模型加工面板')
|
||||
model_surface_process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||
model_process_parameters_id = fields.Many2one('sf.processing.technology', string='工艺参数')
|
||||
# model_surface_process_category_id = fields.Many2one('sf.production.process.category', string='表面工艺类别')
|
||||
model_surface_process_id = fields.Many2many('sf.production.process', 'rel_product_process', string='表面工艺')
|
||||
model_process_parameters_id = fields.Many2many('sf.processing.technology', 'rel_product_technology', string='工艺参数')
|
||||
# model_price = fields.Float('模型单价', digits=(16, 3))
|
||||
model_remark = fields.Char('模型备注说明')
|
||||
length = fields.Float('长[mm]', digits=(16, 3))
|
||||
@@ -108,8 +109,8 @@ class ResProductTemplate(models.Model):
|
||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||
'model_surface_process_id': self.env['sf.production.process'].search(
|
||||
[('process_encode', '=', item['surface_process_code'])]).id,
|
||||
# 'model_process_parameters_id': self.env['sf.processing.technology'].search(
|
||||
# [('process_encode', '=', item['process_parameters_code'])]).id,
|
||||
'model_process_parameters_id': self.env['sf.processing.technology'].search(
|
||||
[('process_encode', '=', item['process_parameters_code'])]).id,
|
||||
'model_remark': item['remark'],
|
||||
'default_code': '%s-%s' % (order_number, i),
|
||||
# 'barcode': item['barcode'],
|
||||
@@ -182,14 +183,15 @@ class ResProductTemplate(models.Model):
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if vals['upload_model_file']:
|
||||
for item in vals['upload_model_file']:
|
||||
attachment = self.env['ir.attachment'].sudo().search([('id', '=', int(item[2][0]))])
|
||||
base64_data = base64.b64encode(attachment.datas)
|
||||
base64_datas = base64_data.decode('utf-8')
|
||||
model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
report_path = attachment._full_path(attachment.store_fname)
|
||||
vals['model_file'] = self.transition_glb_file(report_path, model_code)
|
||||
if vals.get('upload_model_file'):
|
||||
if vals.get('is_bfm') is False and vals.get('categ_type') == '成品':
|
||||
for item in vals['upload_model_file']:
|
||||
attachment = self.env['ir.attachment'].sudo().search([('id', '=', int(item[2][0]))])
|
||||
base64_data = base64.b64encode(attachment.datas)
|
||||
base64_datas = base64_data.decode('utf-8')
|
||||
model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
report_path = attachment._full_path(attachment.store_fname)
|
||||
vals['model_file'] = self.transition_glb_file(report_path, model_code)
|
||||
self._sanitize_vals(vals)
|
||||
templates = super(ResProductTemplate, self).create(vals_list)
|
||||
if "create_product_product" not in self._context:
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
<field name="detailed_type" position="before">
|
||||
<field name='categ_type' invisible="1"/>
|
||||
<field name="upload_model_file"
|
||||
widget="many2many_binary"/>
|
||||
widget="many2many_binary"
|
||||
attrs="{'invisible': ['|', ('categ_type', '!=', '成品'),('categ_type', '=', False)]}"/>
|
||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
attrs="{'invisible': ['|', ('categ_type', '!=', '成品'),('categ_type', '=', False)]}"/>
|
||||
</field>
|
||||
@@ -24,6 +25,8 @@
|
||||
<field name="materials_id" string="材料"/>
|
||||
<field name="materials_type_id" string="型号"
|
||||
domain="[('materials_id', '=', materials_id)]"/>
|
||||
<field name="model_surface_process_id" string="表面工艺" widget="many2many_tags"/>
|
||||
<field name="model_process_parameters_id" string="工艺参数" widget="many2many_tags"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
'assets': {
|
||||
},
|
||||
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': True,
|
||||
# 'auto_install': False,
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -248,7 +248,7 @@ class MrpProduction(models.Model):
|
||||
if work.name == '获取CNC加工程序':
|
||||
work.button_start()
|
||||
#work.button_finish()
|
||||
work.fetchCNC()
|
||||
#work.fetchCNC()
|
||||
|
||||
#创建工单并进行排序
|
||||
def _create_workorder(self):
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -24,10 +24,10 @@ class ResConfigSettings(models.TransientModel):
|
||||
_logger.info("同步资源库材料")
|
||||
self.env['sf.materials.model'].sync_all_materials_model()
|
||||
_logger.info("同步资源库材料型号")
|
||||
self.env['sf.production.process'].sync_all_production_process()
|
||||
_logger.info("同步资源库表面工艺")
|
||||
self.env['sf.production.process.category'].sync_all_production_process_category()
|
||||
_logger.info("同步资源库表面工艺类别")
|
||||
self.env['sf.production.process'].sync_all_production_process()
|
||||
_logger.info("同步资源库表面工艺")
|
||||
self.env['sf.processing.technology'].sync_all_processing_technology()
|
||||
_logger.info("同步资源库加工工艺")
|
||||
self.env['sf.machine.brand.tags'].sync_all_machine_brand_tags()
|
||||
|
||||
@@ -212,7 +212,7 @@ class sfProductionProcessCategory(models.Model):
|
||||
for item in result['production_process_category_all_list']:
|
||||
if item:
|
||||
category = self.env['sf.production.process.category'].search(
|
||||
[("process_encode", '=', item['process_encode'])])
|
||||
[("code", '=', item['code'])])
|
||||
if not category:
|
||||
self.env['sf.production.process.category'].create({
|
||||
"name": item['name'],
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
Reference in New Issue
Block a user