Compare commits
7 Commits
master_sf_
...
feature/优化
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3baf3e60e8 | ||
|
|
0d7f348194 | ||
|
|
e12755783c | ||
|
|
f2415ae80d | ||
|
|
7d4314abc7 | ||
|
|
28a3d52aea | ||
|
|
7e93586f69 |
@@ -9,6 +9,8 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
_name = 'purchase.order'
|
||||
_inherit = ['purchase.order', 'tier.validation']
|
||||
_description = "采购订单"
|
||||
_state_from = ["draft", "to approve", "rejected"]
|
||||
_state_to = ["approved"]
|
||||
|
||||
_tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]"
|
||||
|
||||
@@ -21,7 +23,7 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
|
||||
def button_confirm(self):
|
||||
for record in self:
|
||||
if record.state in ['to approve']:
|
||||
if record.need_validation and not record.validation_status == 'validated':
|
||||
raise ValidationError(_('请先完成审批。'))
|
||||
res = super(jikimo_purchase_tier_validation, self).button_confirm()
|
||||
for record in self:
|
||||
@@ -68,11 +70,6 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
|
||||
return res
|
||||
|
||||
def _rejected_tier(self, tiers=False):
|
||||
res = super(jikimo_purchase_tier_validation, self)._rejected_tier(tiers)
|
||||
self.state = 'draft'
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _get_under_validation_exceptions(self):
|
||||
res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook/page[last()]" position="after">
|
||||
<field name="routing_type" invisible="1"/>
|
||||
<page string="异常记录" name="workorder_exception" attrs="{'invisible': [('routing_type', '!=', 'CNC加工')]}">
|
||||
<page string="异常记录" name="workorder_exception" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "ER")]}'>
|
||||
<field name="exception_ids" nolabel="1" readonly="1">
|
||||
<tree create="false" delete="false" edit="false">
|
||||
<field name="exception_content" string="反馈的异常/问题信息"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
||||
<page string="开料要求" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "CMR")]}'>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_tmpl_id_materials_id" widget="many2one"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[last()-3]" position="before">
|
||||
<!-- <page string="下发记录" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>-->
|
||||
<page string="下发记录" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<page string="下发记录" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "HDR")]}'>
|
||||
<field name="delivery_records">
|
||||
<tree create="false">
|
||||
<field name="delivery_type"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="inherit_id" ref="mrp.mrp_production_workorder_form_view_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[last()-3]" position="before">
|
||||
<page string="机床信息" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<page string="机床信息" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "MTI")]}'>
|
||||
<group string="机床信息">
|
||||
<group>
|
||||
<field name="machine_tool_name"/>
|
||||
|
||||
@@ -4,5 +4,63 @@
|
||||
<field name="code">PTD</field>
|
||||
<field name="name">后置三元检测</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_2">
|
||||
<field name="code">WCP</field>
|
||||
<field name="name">工件装夹</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_3">
|
||||
<field name="code">ITD_PP</field>
|
||||
<field name="name">前置三元检测定位参数</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_4">
|
||||
<field name="code">2D_MD</field>
|
||||
<field name="name">2D加工图纸</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_5">
|
||||
<field name="code">QIS</field>
|
||||
<field name="name">质检标准</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_6">
|
||||
<field name="code">WD</field>
|
||||
<field name="name">工件配送</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_9">
|
||||
<field name="code">CNC_P</field>
|
||||
<field name="name">CNC程序</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_10">
|
||||
<field name="code">CMM_P</field>
|
||||
<field name="name">CMM程序</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_11">
|
||||
<field name="code">MTI</field>
|
||||
<field name="name">机床信息</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_12">
|
||||
<field name="code">HDR</field>
|
||||
<field name="name">下发记录</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_13">
|
||||
<field name="code">ER</field>
|
||||
<field name="name">异常记录</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_14">
|
||||
<field name="code">DCP</field>
|
||||
<field name="name">解除装夹</field>
|
||||
</record>
|
||||
<record model="sf.work.individuation.page" id="sf_work_individuation_page_15">
|
||||
<field name="code">CMR</field>
|
||||
<field name="name">开料要求</field>
|
||||
</record>
|
||||
|
||||
<!-- 原生页签先不进行配置 -->
|
||||
<!-- <record model="sf.work.individuation.page" id="sf_work_individuation_page_7">-->
|
||||
<!-- <field name="code">ML</field>-->
|
||||
<!-- <field name="name">物料</field>-->
|
||||
<!-- </record>-->
|
||||
<!-- <record model="sf.work.individuation.page" id="sf_work_individuation_page_8">-->
|
||||
<!-- <field name="code">TT</field>-->
|
||||
<!-- <field name="name">时间跟踪</field>-->
|
||||
<!-- </record>-->
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -365,7 +365,7 @@ class MrpProduction(models.Model):
|
||||
and production.schedule_state == '已排' and production.is_rework is False):
|
||||
production.state = 'pending_cam'
|
||||
if any((wo.test_results == '返工' and wo.state == 'done' and
|
||||
(production.programming_state in ['已编程'] or wo.individuation_page_PTD is True))
|
||||
(production.programming_state in ['已编程'] or 'PTD' in wo.individuation_page_list))
|
||||
or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
|
||||
for wo in production.workorder_ids) or production.is_rework is True:
|
||||
production.state = 'rework'
|
||||
@@ -684,7 +684,6 @@ class MrpProduction(models.Model):
|
||||
logging.info('change_programming_state error:%s' % e)
|
||||
raise UserError("修改编程单状态失败,请联系管理员")
|
||||
|
||||
|
||||
# cnc程序获取
|
||||
def fetchCNC(self, production_names):
|
||||
cnc = self.env['mrp.production'].search([('id', '=', self.id)])
|
||||
@@ -714,9 +713,9 @@ class MrpProduction(models.Model):
|
||||
[('id', '=', cnc.product_id.materials_type_id.id)]).materials_no,
|
||||
'machining_processing_panel': cnc.product_id.model_processing_panel,
|
||||
'machining_precision': '',
|
||||
'embryo_long': cnc.product_id.bom_ids.bom_line_ids.product_id.length,
|
||||
'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,
|
||||
'embryo_long': cnc.product_id.bom_ids[0].bom_line_ids.product_id.length,
|
||||
'embryo_height': cnc.product_id.bom_ids[0].bom_line_ids.product_id.height,
|
||||
'embryo_width': cnc.product_id.bom_ids[0].bom_line_ids.product_id.width,
|
||||
'order_no': cnc.origin,
|
||||
'model_order_no': cnc.product_id.default_code,
|
||||
'user': cnc.env.user.name,
|
||||
@@ -1298,12 +1297,14 @@ class MrpProduction(models.Model):
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_production_id': self.id,
|
||||
'default_is_clamping': True if self.workorder_ids.filtered(lambda wk: wk.routing_type == '装夹预调') else False,
|
||||
'default_is_clamping': True if self.workorder_ids.filtered(
|
||||
lambda wk: wk.routing_type == '装夹预调') else False,
|
||||
'default_workorder_ids': workorder_ids.ids if workorder_ids.ids != [] else self.workorder_ids.ids,
|
||||
'default_hidden_workorder_ids': ','.join(map(str, work_id_list)) if work_id_list != [] else '',
|
||||
'default_reprogramming_num': cloud_programming.get('reprogramming_num') if cloud_programming else '',
|
||||
'default_programming_state': cloud_programming.get('programming_state') if cloud_programming else '',
|
||||
'default_is_reprogramming': True if cloud_programming and (cloud_programming.get('programming_state') in ['已下发']) else False
|
||||
'default_is_reprogramming': True if cloud_programming and (
|
||||
cloud_programming.get('programming_state') in ['已下发']) else False
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,7 +1338,8 @@ class MrpProduction(models.Model):
|
||||
for rework_item in rework_workorder:
|
||||
pending_workorder = production.workorder_ids.filtered(
|
||||
lambda m1: m1.state in [
|
||||
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type in ['CNC加工', '人工线下加工'])
|
||||
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type in [
|
||||
'CNC加工', '人工线下加工'])
|
||||
if not pending_workorder.cnc_ids:
|
||||
production.get_new_program(rework_item.processing_panel)
|
||||
# production.write({'state': 'progress', 'programming_state': '已编程', 'is_rework': False})
|
||||
@@ -1380,7 +1382,8 @@ class MrpProduction(models.Model):
|
||||
if productions:
|
||||
for production in productions:
|
||||
panel_workorder = production.workorder_ids.filtered(lambda
|
||||
pw: pw.processing_panel == processing_panel and pw.routing_type in ['CNC加工', '人工线下加工'] and pw.state not in (
|
||||
pw: pw.processing_panel == processing_panel and pw.routing_type in [
|
||||
'CNC加工', '人工线下加工'] and pw.state not in (
|
||||
'rework', 'done'))
|
||||
if panel_workorder:
|
||||
if panel_workorder.cmm_ids:
|
||||
@@ -1406,7 +1409,8 @@ class MrpProduction(models.Model):
|
||||
'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())})
|
||||
logging.info('len(cnc_worksheet):%s' % len(panel_workorder.cnc_worksheet))
|
||||
pre_workorder = production.workorder_ids.filtered(lambda
|
||||
ap: ap.routing_type in ['装夹预调', '人工线下加工'] and ap.processing_panel == processing_panel and ap.state not in (
|
||||
ap: ap.routing_type in ['装夹预调',
|
||||
'人工线下加工'] and ap.processing_panel == processing_panel and ap.state not in (
|
||||
'rework', 'done'))
|
||||
if pre_workorder:
|
||||
pre_workorder.write(
|
||||
|
||||
@@ -1442,7 +1442,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
record.production_id.process_state = '待加工'
|
||||
# 生成工件配送单
|
||||
record.workpiece_delivery_ids = record._json_workpiece_delivery_list()
|
||||
if record.routing_type == 'CNC加工' or record.individuation_page_PTD is True:
|
||||
if record.routing_type == 'CNC加工' or 'PTD' in record.individuation_page_list:
|
||||
if record.routing_type == 'CNC加工':
|
||||
record.process_state = '待解除装夹'
|
||||
# record.write({'process_state': '待加工'})
|
||||
@@ -1676,10 +1676,10 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# ==============================配置化页签--个性化记录===================================
|
||||
routing_workcenter_id = fields.Many2one('mrp.routing.workcenter', compute='_compute_routing_workcenter_id',
|
||||
store=True)
|
||||
store=True, string='工序作业')
|
||||
individuation_page_ids = fields.Many2many('sf.work.individuation.page', string='个性化记录', store=True,
|
||||
compute='_compute_individuation_page_ids')
|
||||
individuation_page_PTD = fields.Boolean('个性化记录(是否显示后置三元检测[PTD]页签)', default=False)
|
||||
individuation_page_list = fields.Char('个性化记录', default=None)
|
||||
|
||||
@api.depends('name')
|
||||
def _compute_routing_workcenter_id(self):
|
||||
@@ -1695,10 +1695,11 @@ class ResMrpWorkOrder(models.Model):
|
||||
if mw.routing_workcenter_id:
|
||||
mw.individuation_page_ids = mw.routing_workcenter_id.individuation_page_ids.ids
|
||||
# 初始化页签配置
|
||||
mw.individuation_page_PTD = False
|
||||
mw.individuation_page_list = None
|
||||
# 根据工单对应的【作业_个性化记录】配置页签
|
||||
if any(item.code == 'PTD' for item in mw.routing_workcenter_id.individuation_page_ids):
|
||||
mw.individuation_page_PTD = True
|
||||
individuation_page_list = [item.code for item in mw.routing_workcenter_id.individuation_page_ids]
|
||||
if individuation_page_list:
|
||||
mw.individuation_page_list = list(set(individuation_page_list))
|
||||
|
||||
# =============================================================================================
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import requests
|
||||
import base64
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.modules import get_resource_path
|
||||
@@ -776,10 +777,33 @@ class ResProductMo(models.Model):
|
||||
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
|
||||
machining_drawings = fields.Binary('2D加工图纸', readonly=True)
|
||||
quality_standard = fields.Binary('质检标准', readonly=True)
|
||||
part_name = fields.Char(string='零件名称', readonly=True)
|
||||
part_number = fields.Char(string='零件图号', readonly=True)
|
||||
part_name = fields.Char(string='零件名称', compute='_compute_related_product', readonly=True, store=True)
|
||||
part_number = fields.Char(string='零件图号', compute='_compute_related_product', readonly=True, store=True)
|
||||
machining_drawings_name = fields.Char(string='零件图号名称', readonly=True)
|
||||
machining_drawings_mimetype = fields.Char(string='零件图号类型', readonly=True)
|
||||
|
||||
@api.depends('name')
|
||||
def _compute_related_product(self):
|
||||
for record in self:
|
||||
if record.categ_id.name == '坯料':
|
||||
product_name = ''
|
||||
match = re.search(r'(S\d{5}-\d)', record.name)
|
||||
# 如果匹配成功,提取结果
|
||||
if match:
|
||||
product_name = match.group(0)
|
||||
sale_order_name = ''
|
||||
match_sale = re.search(r'S(\d+)', record.name)
|
||||
if match_sale:
|
||||
sale_order_name = match_sale.group(0)
|
||||
sale_order = self.env['sale.order'].sudo().search(
|
||||
[('name', '=', sale_order_name)])
|
||||
if sale_order:
|
||||
filtered_order_line = sale_order.order_line.filtered(
|
||||
lambda order_line: re.search(f'{product_name}$', order_line.product_id.name)
|
||||
)
|
||||
record.part_number = filtered_order_line.product_id.part_number if filtered_order_line else None
|
||||
record.part_name = filtered_order_line.product_id.part_name if filtered_order_line else None
|
||||
|
||||
@api.constrains('tool_length')
|
||||
def _check_tool_length_size(self):
|
||||
if self.tool_length > 1000000:
|
||||
|
||||
@@ -227,8 +227,7 @@
|
||||
<!-- attrs='{"invisible": [("rework_flag","=",True)]}' confirm="是否返工"/>-->
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="开料要求"
|
||||
attrs='{"invisible": [("routing_type","not in",("切割", "线切割", "人工线下加工"))]}'>
|
||||
<page string="开料要求" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "CMR")]}'>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_tmpl_id_materials_id" widget="many2one"/>
|
||||
@@ -325,7 +324,7 @@
|
||||
|
||||
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="工件装夹" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||
<page string="工件装夹" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "WCP")]}'>
|
||||
<group>
|
||||
<!-- <field name="_barcode_scanned" widget="barcode_handler"/> -->
|
||||
<group string="托盘">
|
||||
@@ -347,7 +346,7 @@
|
||||
placeholder="如有预调程序信息请在此处输入....."/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="前置三元检测定位参数" attrs='{"invisible": [("routing_type","!=","装夹预调")]}'>
|
||||
<page string="前置三元检测定位参数" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "ITD_PP")]}'>
|
||||
|
||||
<div>左面:</div>
|
||||
<div class="o_address_format">
|
||||
@@ -504,17 +503,15 @@
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="2D加工图纸"
|
||||
attrs='{"invisible": [("routing_type","not in",["装夹预调", "人工线下加工"])]}'>
|
||||
<page string="2D加工图纸" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "2D_MD")]}'>
|
||||
<field name="machining_drawings" widget="adaptive_viewer"/>
|
||||
</page>
|
||||
|
||||
<page string="质检标准" attrs="{'invisible': [('routing_type','!=','装夹预调')]}">
|
||||
<page string="质检标准" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "QIS")]}'>
|
||||
<field name="quality_standard" widget="adaptive_viewer"/>
|
||||
</page>
|
||||
|
||||
<page string="工件配送"
|
||||
attrs="{'invisible': [('routing_type','!=','装夹预调')]}">
|
||||
<page string="工件配送" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "WD")]}'>
|
||||
<field name="workpiece_delivery_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="production_id" invisible="1"/>
|
||||
@@ -542,11 +539,19 @@
|
||||
attrs='{"invisible": ["|", ("state","!=","progress"), ("routing_type","!=","装夹预调")]}'/>
|
||||
</xpath>
|
||||
|
||||
<!-- =====原生页签,暂时不进行配置===== -->
|
||||
<!-- <xpath expr="//page[@name='components']" position="attributes">-->
|
||||
<!-- <attribute name="attrs">{"invisible": ["!", ("individuation_page_list", "ilike", "ML")]}</attribute>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//page[@name='time_tracking']" position="attributes">-->
|
||||
<!-- <attribute name="attrs">{"invisible": ["!", ("individuation_page_list", "ilike", "TT")]}</attribute>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- ============================= -->
|
||||
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<field name="results" invisible="1"/>
|
||||
<field name="individuation_page_PTD" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": [("individuation_page_PTD", "=", False)]}'>
|
||||
<field name="individuation_page_list" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "PTD")]}'>
|
||||
<group>
|
||||
<field name="test_results"
|
||||
attrs='{"readonly":["&","|",("state","!=","to be detected"), "|",("routing_type","=","CNC加工"),("is_inspect", "=", True),("state","in",["done","rework"])],
|
||||
@@ -568,16 +573,16 @@
|
||||
<!-- attrs='{"invisible": ["|","|",("state","!=","progress"),("user_permissions","=",False),("results","=","合格")]}'/>-->
|
||||
<!-- </div>-->
|
||||
</page>
|
||||
<page string="2D加工图纸" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<page string="2D加工图纸" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "2D_MD")]}'>
|
||||
<field name="machining_drawings" widget="adaptive_viewer"/>
|
||||
</page>
|
||||
|
||||
<page string="质检标准" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<page string="质检标准" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "QIS")]}'>
|
||||
<field name="quality_standard" widget="adaptive_viewer"/>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="CNC程序" attrs='{"invisible": [("routing_type","not in",["CNC加工", "人工线下加工"])]}'>
|
||||
<page string="CNC程序" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "CNC_P")]}'>
|
||||
<field name="cnc_ids" widget="one2many" string="工作程序" default_order="sequence_number,id"
|
||||
readonly="0">
|
||||
<tree>
|
||||
@@ -601,7 +606,7 @@
|
||||
</field>
|
||||
|
||||
</page>
|
||||
<page string="CMM程序" attrs='{"invisible": [("routing_type","not in",["CNC加工", "人工线下加工"])]}'>
|
||||
<page string="CMM程序" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "CMM_P")]}'>
|
||||
<field name="cmm_ids" widget="one2many" string="CMM程序" readonly="1">
|
||||
<tree>
|
||||
<field name="sequence_number"/>
|
||||
@@ -614,7 +619,7 @@
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
||||
<page string="解除装夹" attrs='{"invisible": ["!", ("individuation_page_list", "ilike", "DCP")]}'>
|
||||
<!-- <field name="tray_id" readonly="1"/>-->
|
||||
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
||||
<!-- <button type="object" class="oe_highlight" name="unbindtray" string="解除装夹"-->
|
||||
|
||||
@@ -67,6 +67,16 @@
|
||||
<filter string="追溯参考" name="retrospect" domain="[]"
|
||||
context="{'group_by': 'retrospect_ref'}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='picking_type_id']" position="after">
|
||||
<field name="product_id"
|
||||
string="零件图号"
|
||||
filter_domain="[('product_id.part_number', 'ilike', self)]"
|
||||
/>
|
||||
<field name="product_id"
|
||||
string="零件名称"
|
||||
filter_domain="[('product_id.part_name', 'ilike', self)]"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class QualityCheck(models.Model):
|
||||
('cancel', '已取消'), ], string='状态', tracking=True, store=True,
|
||||
default='none', copy=False, compute='_compute_quality_state')
|
||||
|
||||
individuation_page_PTD = fields.Boolean('个性化记录(是否显示后置三元检测[PTD]页签)', related='workorder_id.individuation_page_PTD')
|
||||
individuation_page_list = fields.Char('个性化记录', related='workorder_id.individuation_page_list')
|
||||
work_state = fields.Selection(related='workorder_id.state', string='工单状态')
|
||||
processing_panel = fields.Char(related='workorder_id.processing_panel', string='加工面')
|
||||
|
||||
@@ -93,7 +93,7 @@ class QualityCheck(models.Model):
|
||||
raise ValidationError('请填写【判定结果】里的信息')
|
||||
if self.test_results == '合格':
|
||||
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
||||
if self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_PTD is False:
|
||||
if self.workorder_id.routing_type != 'CNC加工' and 'PTD' not in self.workorder_id.individuation_page_list:
|
||||
self.workorder_id.production_id.write({'detection_result_ids': [(0, 0, {
|
||||
'rework_reason': self.reason,
|
||||
'detailed_reason': self.detailed_reason,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<xpath expr="//field[@name='alert_ids']" position="after">
|
||||
<field name="production_id" invisible="1"/>
|
||||
<field name="work_state" invisible="1"/>
|
||||
<field name="individuation_page_PTD" invisible="1"/>
|
||||
<field name="individuation_page_list" invisible="1"/>
|
||||
<field name="production_line_id" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||
<field name="equipment_id" attrs="{'invisible': [('production_id', '=', False)]}"/>
|
||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
|
||||
@@ -42,20 +42,20 @@
|
||||
<field name="currency_id" position="after">
|
||||
<field name="remark" attrs="{'readonly': [('state', 'in', ['purchase'])]}" string="订单备注"/>
|
||||
</field>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">
|
||||
<button name="action_rfq_send" states="draft" string="通过Email发送采购单" type="object"
|
||||
context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="replace">
|
||||
<button name="action_rfq_send" states="sent" string="通过Email重新发送采购单" type="object"
|
||||
context="{'send_rfq':True}" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="replace">
|
||||
<button name="action_rfq_send" states="purchase" string="通过Email发送订单" type="object"
|
||||
context="{'send_rfq':False}" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='print_quotation'][1]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='print_quotation'][2]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
|
||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
||||
@@ -353,5 +353,9 @@
|
||||
</field>
|
||||
<field name="view_mode">tree,kanban,form,activity</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase.purchase_rfq" model="ir.actions.act_window">
|
||||
<field name="context">{'quotation_only': True,"search_default_draft":1}</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1140,7 +1140,7 @@ class SfPickingType(models.Model):
|
||||
action = super(SfPickingType, self)._get_action(action_xmlid)
|
||||
if not self.env.user.has_group('base.group_system'):
|
||||
action['context']['create'] = False
|
||||
if self.sequence_code in ['DL', 'INT', 'PC']:
|
||||
if self.sequence_code in ['INT', 'PC']:
|
||||
action['context']['search_default_retrospect'] = 1
|
||||
return action
|
||||
|
||||
|
||||
Reference in New Issue
Block a user