新增质量团队和控制点的审核按钮

This commit is contained in:
jinling.yang
2023-12-07 10:50:36 +08:00
parent 8d5a4ed4c8
commit 640bf79dc8
8 changed files with 71 additions and 36 deletions

View File

@@ -7,10 +7,15 @@
<field name="model">quality.point</field>
<field name="arch" type="xml">
<form>
<header>
</header>
<sheet>
<div class="oe_button_box" name="button_box"/>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<h2><field name="name" readonly="1"/></h2>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"/>
<h2>
<field name="name" readonly="1"/>
</h2>
<group>
<group>
<field name="active" invisible="1"/>
@@ -33,13 +38,14 @@
<field name="note" placeholder="Describe the quality check to do..."/>
</page>
<page string="Notes" name="Notes">
<field name="reason" string="Note" placeholder="Describe why you need to perform this quality check..."/>
<field name="reason" string="Note"
placeholder="Describe why you need to perform this quality check..."/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="message_ids"/>
<field name="message_follower_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
@@ -85,17 +91,18 @@
<filter name="filter_date_close" date="date_close"/>
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<group expand="0" string="Group By">
<filter string="Stage" name="groupby_stage" domain="[]" context="{'group_by': 'stage_id'}"/>
<filter string="Responsible" name="groupby_user" domain="[]" context="{'group_by': 'user_id'}"/>
<filter string="Root Cause" name="groupby_reason" domain="[]" context="{'group_by': 'reason_id'}"/>
<filter string="Creation Date" name="groupby_createmonth" domain="[]" context="{'group_by': 'create_date'}"/>
<filter string="Creation Date" name="groupby_createmonth" domain="[]"
context="{'group_by': 'create_date'}"/>
<filter string="Quality Team" name="groupby_team_id" domain="[]" context="{'group_by': 'team_id'}"/>
</group>
</search>
@@ -122,4 +129,4 @@
</record>
<!-- js stuff -->
</odoo>
</odoo>

View File

@@ -602,6 +602,7 @@
<field name="model">quality.alert.team</field>
<field name="arch" type="xml">
<form>
<header></header>
<sheet>
<div class="oe_title">
<label for="name" string="Team Name"/>

View File

@@ -6,8 +6,8 @@ import os
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
class ResProductMo(models.Model):

View File

@@ -13,7 +13,7 @@
'author': 'jikimo',
'website': 'https://sf.cs.jikimo.com',
# 此处依赖sf_manufacturing是因为我要重写其中的一个字段operation_id的string故需要sf_manufacturing先安装
'depends': ['quality_control', 'sf_manufacturing'],
'depends': ['quality_control'],
'data': [
'security/ir.model.access.csv',
'views/view.xml'

View File

@@ -21,3 +21,16 @@ class SfQualityPoint(models.Model):
self.check_state = 'enable'
# picking_type_ids = fields.Many2many(
# 'stock.picking.type', string='执行节点', required=True, check_company=True)
class ResQualityAlertTeam(models.Model):
_inherit = 'quality.alert.team'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
# 审核
def action_check(self):
self.check_state = 'enable'

View File

@@ -35,15 +35,29 @@
<record model="ir.ui.view" id="quality_point_view_form_inherit_sf">
<field name="name">quality.point.form.inherit.sf</field>
<field name="model">quality.point</field>
<field name="inherit_id" ref="quality_control.quality_point_view_form_inherit_quality_control"/>
<field name="inherit_id" ref="quality.quality_point_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
class="oe_highlight"/>
</header>
<xpath expr="//header" position="inside">
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_base.group_quality_director"
class="oe_highlight"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="quality_alert_team_view_form_inherit_sf">
<field name="name">quality.alert.team.form.inherit.sf</field>
<field name="model">quality.alert.team</field>
<field name="inherit_id" ref="quality_control.quality_alert_team_view_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_base.group_quality_director"
class="oe_highlight"/>
</xpath>
</field>
</record>

View File

@@ -2,7 +2,7 @@
import logging
from odoo.modules import get_resource_path
from odoo import fields, models, api
# from quatotion import readSql, feature_recognize, auto_quatotion
from quatotion import readSql, feature_recognize, auto_quatotion
__author__ = 'jinling.yang'
_logger = logging.getLogger(__name__)
@@ -24,14 +24,14 @@ class AutoQuatotion(models.Model):
def get_process_time_db_path(self):
return get_resource_path('sf_sale', 'models', 'process_time.db')
# def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
# '''
# 通过打包好的.so库
# 以调用autoQuatotion库中Quatotion类
# 初始化后调用类的analyseShape方法对模型文件进行价格预测
# '''
# # 初始化自动报价类(输入特征数据库和加工时间数据库)
# reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
# # 获取价格、加工时间、尺寸、XYZ、翻面次数
# feature_info = reader.analyseShape(stp_url, InfoJson={})
# return feature_info
def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
'''
通过打包好的.so库
以调用autoQuatotion库中Quatotion类
初始化后调用类的analyseShape方法对模型文件进行价格预测
'''
# 初始化自动报价类(输入特征数据库和加工时间数据库)
reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
# 获取价格、加工时间、尺寸、XYZ、翻面次数
feature_info = reader.analyseShape(stp_url, InfoJson={})
return feature_info

View File

@@ -5,8 +5,8 @@ import os
import json
from datetime import datetime
import requests
# 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
from odoo import models, fields, api
from odoo.modules import get_resource_path
from odoo.exceptions import ValidationError, UserError