Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/权限去掉继承

This commit is contained in:
jinling.yang
2023-12-11 14:48:08 +08:00
18 changed files with 996 additions and 441 deletions

View File

@@ -4,7 +4,7 @@ csv_internal_sep = ,
data_dir = /var/lib/odoo
db_host = 172.17.0.2
db_maxconn = 64
db_name = sf_cs937
db_name = sf_t2cs_001
db_password = sf
db_port = 5432
db_sslmode = prefer

View File

@@ -6,6 +6,7 @@ import cpca
# from odoo.exceptions import UserError
# from odoo.exceptions import ValidationError
from odoo import api, fields, models
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
@@ -60,38 +61,46 @@ class JdEclp(models.Model):
@api.depends('origin')
def _truck_info(self):
"""
根据销售订单号,获取收货人信息
"""
# if 'S' in self.origin:
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
# self.receiverCountyName and self.receiverTownName:
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
# if sale_order_id.address_of_delivery != False:
# if not sale_order_id:
# raise ValidationError("找不到对应的销售订单")
try:
if 'OUT' in self.name:
raw_addres = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
# _logger.info('=================dddd====', sale_order_id.address_of_delivery)
# _logger.info('========================================', raw_addres)
# _logger.info('=================dddd====', self.display_name)
# _logger.info('=================dddd====', type(self.display_name))
# # _logger.info(self.receiverName, self.receiverMobile)
# _logger.info(1111111111111111111111111111111111111111111111)
self.receiverName = sale_order_id.person_of_delivery
self.receiverMobile = sale_order_id.telephone_of_delivery
self.receiverProvinceName = cpca.transform(raw_addres).values.tolist()[0][0]
self.receiverCityName = cpca.transform(raw_addres).values.tolist()[0][1]
self.receiverCountyName = cpca.transform(raw_addres).values.tolist()[0][2]
self.receiverTownName = cpca.transform(raw_addres).values.tolist()[0][3]
if 'OUT' in self.name and sale_order_id.address_of_delivery:
raw_address = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
if sale_order_id.person_of_delivery:
self.receiverName = sale_order_id.person_of_delivery
if sale_order_id.telephone_of_delivery:
self.receiverMobile = sale_order_id.telephone_of_delivery
if raw_address:
self.receiverProvinceName = cpca.transform(raw_address).values.tolist()[0][0]
self.receiverCityName = cpca.transform(raw_address).values.tolist()[0][1]
self.receiverCountyName = cpca.transform(raw_address).values.tolist()[0][2]
self.receiverTownName = cpca.transform(raw_address).values.tolist()[0][3]
else:
self.receiverName = self.receiverName
self.receiverMobile = self.receiverMobile
self.receiverProvinceName = self.receiverProvinceName
self.receiverCityName = self.receiverCityName
self.receiverCountyName = self.receiverCountyName
self.receiverTownName = self.receiverTownName
self.receiverName = False
self.receiverMobile = False
self.receiverProvinceName = False
self.receiverCityName = False
self.receiverCountyName = False
self.receiverTownName = False
except Exception as e:
print(f"Error address is none: {e}")
raise ValidationError(f"传值有误: {e}")
def create_order(self):
"""
创建订单
"""
if not self.receiverName or not self.receiverMobile or not self.receiverProvinceName \
or not self.receiverCityName or not self.receiverCountyName or not self.receiverTownName:
raise ValidationError("当前销售订单缺失收货人信息,补充后才可发起物流!")
# sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
# if self.carrier_id == '京东物流':
@@ -140,6 +149,8 @@ class JdEclp(models.Model):
"""
获取物流面单
"""
if not self.carrier_tracking_ref:
raise ValidationError("未下物流单,请先点击京东物流下单按钮!")
config = self.env['res.config.settings'].get_values()
json1 = {
'params': {

View File

@@ -873,13 +873,3 @@ class SfMaintenanceEquipmentTool(models.Model):
for record in self:
if record.code:
record.name = record.code
@api.model_create_multi
def create(self, vals_list):
tools = super().create(vals_list)
for tool in tools:
self.env['sf.machine.table.tool.changing.apply'].sudo().create({
'maintenance_equipment_id': tool.equipment_id.id,
'cutter_spacing_code_id': tool.id
})
return tools

View File

@@ -32,7 +32,7 @@ class MrStaticResourceDataSync(models.Model):
# logging.info("材料型号已每日同步成功")
# self.env['mrs.international.standards']._cron_mrs_international_standards_func()
# logging.info("材料型号材料应用已每日同步成功")
self.env['material.apply']._cron_material_apply_func()
self.env['material.apply'].sync_material_apply()
logging.info("材料型号材料应用已每日同步成功")
self.env['sf.production.process.category'].sync_production_process_category_yesterday()
logging.info("表面工艺类别已每日同步成功")

View File

@@ -40,6 +40,8 @@
name="open_work_schedule_calendar"
class="oe_highlight"
/>
<button name="action_check" string="启用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
<button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/>
<field name="status" widget="statusbar" statusbar_visible="正常,禁用"/>
</header>
<sheet string-="工作日历设置">

View File

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

View File

@@ -1,3 +1,20 @@
# -*-coding:utf-8-*-
from . import models
from . import wizard
# from odoo import api, SUPERUSER_ID
# import logging
# _logger = logging.getLogger(__name__)
#
#
# def _sf_tool_management_post_install(cr, registry):
# # 这里执行你想要在安装模块时执行的操作,包括调用和执行模型的方法
# env = api.Environment(cr, SUPERUSER_ID, {})
#
# # 获取需要执行方法的模型
# model_obj = env['sf.machine.table.tool.changing.apply']
# logging.info('post_install方法执行了')
# print('post_install方法执行了')
#
# # 调用模型方法
# model_obj.create_tool_change_application()

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- <record model="sf.machine.table.tool.changing.apply" id="sf_create_tool_change_application">-->
<!-- </record>-->
</data>
</odoo>

View File

@@ -1,2 +1,4 @@
from . import base
from . import tool_material_search
from . import maintenance_equipment

View File

@@ -41,13 +41,10 @@ class FunctionalCuttingToolEntity(models.Model):
def _compute_current_location_id(self):
for record in self:
if record.barcode_id.quant_ids:
print(record.barcode_id.quant_ids)
for quant_id in record.barcode_id.quant_ids:
if quant_id.inventory_quantity_auto_apply > 0:
print(quant_id)
record.current_location_id = quant_id.location_id
record.current_location = quant_id.location_id.name
print(record.current_location_id)
if record.current_location_id:
record.get_location_num()
else:
@@ -161,7 +158,7 @@ class FunctionalToolWarning(models.Model):
production_line_id = fields.Many2one('sf.production.line', string='生产线',
group_expand='_read_group_machine_table_name_ids')
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='CNC机床')
machine_tool_code = fields.Char(string='机台号')
machine_tool_code = fields.Char(string='机台号', related='maintenance_equipment_id.name')
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型')
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号',
domain="[('equipment_id', '=', maintenance_equipment_id)]")
@@ -222,7 +219,7 @@ class StockMoveLine(models.Model):
related='functional_tool_name_id.functional_tool_type_id')
diameter = fields.Integer(string='刀具直径(mm)', related='functional_tool_name_id.functional_tool_diameter')
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)', related='functional_tool_name_id.knife_tip_r_angle')
install_tool_time = fields.Datetime("刀具组装时间")
install_tool_time = fields.Datetime("刀具组装时间", related='functional_tool_name_id.tool_loading_time')
@api.model
def _read_group_functional_tool_type_id(self, categories, domain, order):
@@ -339,7 +336,7 @@ class MachineTableToolChangingApply(models.Model):
group_expand='_read_group_names')
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
compute='_compute_machine_table_type_id')
machine_tool_code = fields.Char(string='机台号', store=True, invisible=True, readonly=True)
machine_tool_code = fields.Char(string='机台号', related='maintenance_equipment_id.name')
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号', readonly=True,
required=True, domain="[('equipment_id', '=', maintenance_equipment_id)]")
# 功能刀具信息
@@ -355,7 +352,7 @@ class MachineTableToolChangingApply(models.Model):
[('BT刀柄式', 'BT刀柄式'), ('SK刀柄式', 'SK刀柄式'), ('HSK刀柄式', 'HSK刀柄式'),
('CAT刀柄式', 'CAT刀柄式'), ('ISO刀盘式', 'ISO刀盘式'), ('DIN刀盘式', 'DIN刀盘式'),
('直装固定式', '直装固定式')], string='刀位接口型号')
diameter = fields.Integer(string='刀具直径(mm)', )
diameter = fields.Integer(string='刀具直径(mm)')
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)')
max_lifetime_value = fields.Integer(string='最大寿命值(min)')
alarm_value = fields.Integer(string='报警值(min)')
@@ -479,6 +476,9 @@ class MachineTableToolChangingApply(models.Model):
self.env['sf.machine.table.tool.changing.apply'].search(
[('name', '=', self.name.id)]).write({'status': '0'})
def create_tool_change_application(self):
print("调用了create_tool_change_application()")
class CAMWorkOrderProgramKnifePlan(models.Model):
_name = 'sf.cam.work.order.program.knife.plan'
@@ -487,39 +487,49 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
name = fields.Char(string='工单任务编号', readonly=False)
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
cam_cutter_spacing_code = fields.Char(string='CAM刀位号', readonly=False)
tool_position_interface_type = fields.Selection(
[('BT刀柄式', 'BT刀柄式'), ('SK刀柄式', 'SK刀柄式'), ('HSK刀柄式', 'HSK刀柄式'),
('CAT刀柄式', 'CAT刀柄式'), ('ISO刀盘式', 'ISO刀盘式'), ('DIN刀盘式', 'DIN刀盘式'),
('直装固定式', '直装固定式')], string='刀位接口型号')
production_line_id = fields.Many2one('sf.production.line', string='生产线', readonly=False,
group_expand='_read_group_names')
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False,
domain="[('production_line_id', '=', production_line_id)]")
machine_table_name = fields.Char(string='机台号', readonly=True, related='machine_table_name_id.name')
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号', required=True,
domain="[('equipment_id', '=', machine_table_name_id)]")
whether_standard_knife = fields.Boolean(string='是否标准刀', default=True)
need_knife_time = fields.Datetime(string='用刀时间', readonly=False)
applicant = fields.Char(string='申请人', readonly=True)
applicant_time = fields.Datetime(string='申请时间', readonly=True)
reason_for_applying = fields.Char(string='申请原因', readonly=False)
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号',
domain=[('product_id.name', '=', '功能刀具')])
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称',
domain=[('name', '=', '功能刀具')])
functional_tool_name = fields.Char(string='功能刀具名称', required=True)
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False,
group_expand='_read_group_machine_table_name_ids')
diameter = fields.Integer(string='刀具直径(mm)', readonly=False)
tool_included_angle = fields.Float(string='刀尖R角(mm)', readonly=False)
tool_loading_length = fields.Float(string='装刀长(mm)', readonly=False)
extension_length = fields.Float(string='伸出长(mm)')
effective_length = fields.Float(string='有效长(mm)')
new_former = fields.Selection([('0', ''), ('1', '')], string='新/旧', readonly=False, default='0')
coarse_middle_thin = fields.Selection([("1", ""), ('2', ''), ('3', '')], default='3',
string='粗/中/精', readonly=False)
L_D = fields.Float(string='L/D值', readonly=False)
clearance_length = fields.Float(string='避空长(mm)', readonly=False)
required_cutting_time = fields.Integer(string='需切削时长', readonly=False)
@api.model
def _read_group_machine_table_name_ids(self, categories, domain, order):
machine_table_name_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
return categories.browse(machine_table_name_ids)
machine_tool_cutter_spacing_code = fields.Char(string='机床刀位号', readonly=False)
diameter = fields.Char(string='直径(程式)(mm)', readonly=False)
tool_loading_length = fields.Char(string='装刀长(mm)', readonly=False)
clearance_length = fields.Char(string='避空长(mm)', readonly=False)
tool_included_angle = fields.Char(string='刀尖角R角', readonly=False)
L_D = fields.Char(string='L/D', readonly=False)
coarse_middle_thin = fields.Selection([("1", ""), ('2', ''), ('3', '')], string='粗/中/精', readonly=False,
default='2')
required_cutting_time = fields.Char(string='需切削时长', readonly=False)
whether_standard_tool = fields.Selection([('1', ''), ('0', '')], string='是否标准刀', readonly=False,
default='1')
need_knife_time = fields.Datetime(string='需要用刀时间', readonly=False)
plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')],
string='计划执行状态', default='0', readonly=False)
applicant = fields.Char(string='申请人', readonly=True)
reason_for_applying = fields.Char(string='申请原因', readonly=False)
remark = fields.Char(string='备注说明', readonly=False)
sf_functional_tool_assembly_id = fields.Many2one('sf.functional.tool.assembly', '功能刀具组装', readonly=True)
@api.model
def _read_group_names(self, categories, domain, order):
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
return categories.browse(names)
def apply_for_tooling(self):
"""
申请装刀

View File

@@ -0,0 +1,15 @@
from odoo import models, api
class SfMaintenanceEquipmentTool(models.Model):
_inherit = 'maintenance.equipment.tool'
@api.model_create_multi
def create(self, vals_list):
tools = super().create(vals_list)
for tool in tools:
self.env['sf.machine.table.tool.changing.apply'].sudo().create({
'maintenance_equipment_id': tool.equipment_id.id,
'cutter_spacing_code_id': tool.id
})
return tools

View File

@@ -347,11 +347,13 @@
</group>
<group>
<group string="走刀方向">
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes" readonly="1"
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
readonly="1"
domain="[('id','in',cutting_direction_ids)]"/>
</group>
<group string="适合冷却液">
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes" readonly="1"
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
readonly="1"
domain="[('id','in',suitable_coolant_ids)]"/>
</group>
</group>
@@ -478,7 +480,7 @@
<tree create="0" delete="0">
<field name="name" invisible="1"/>
<field name="production_line_id" invisible="1"/>
<field name="maintenance_equipment_id"/>
<field name="maintenance_equipment_id" invisible="1"/>
<field name="machine_tool_code"/>
<field name="cutter_spacing_code_id"/>
<field name="functional_tool_name_id"/>
@@ -531,7 +533,7 @@
'default_replacement_extension_length': extension_length,
'default_replacement_effective_length': effective_length,
}"
attrs="{'invisible': [('status', '!=', '0')]}"
attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
class="btn-primary"
/>
<button string="转移"
@@ -557,7 +559,7 @@
'default_effective_length': effective_length,
}"
class="btn-primary"
attrs="{'invisible': [('status', '!=', '0')]}"
attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
/>
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary"
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
@@ -605,7 +607,7 @@
'default_replacement_extension_length': extension_length,
'default_replacement_effective_length': effective_length,
}"
attrs="{'invisible': [('status', '!=', '0')]}"
attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
class="btn-primary"
/>
<button string="转移"
@@ -631,7 +633,7 @@
'default_effective_length': effective_length,
}"
class="btn-primary"
attrs="{'invisible': [('status', '!=', '0')]}"/>
attrs="{'invisible': ['|',('status', '!=', '0'),('functional_tool_name_id', '=', False)]}"/>
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary"
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary"
@@ -663,7 +665,8 @@
<group>
<group>
<field name="barcode_id"/>
<field name="functional_tool_name_id"/>
<field name="functional_tool_name_id"
options="{'no_create': True, 'no_quick_create': True}"/>
<field name="functional_tool_type_id"/>
<field name="diameter"/>
<field name="knife_tip_r_angle"/>
@@ -727,20 +730,23 @@
<field name="model">sf.cam.work.order.program.knife.plan</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="name" string="工单编码"/>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="machine_table_name_id"/>
<field name="functional_tool_name_id"/>
<field name="functional_tool_type_id"/>
<field name="machine_tool_cutter_spacing_code"/>
<field name="production_line_id" invisible="1"/>
<field name="machine_table_name_id" invisible="1"/>
<field name="machine_table_name"/>
<field name="functional_tool_name"/>
<field name="diameter"/>
<field name="tool_included_angle"/>
<field name="need_knife_time"/>
<field name="applicant"/>
<field name="remark" optional="hide"/>
<field name="plan_execute_status" invisible="True"/>
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"
attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
<button string="撤回" name="revocation" type="object" class="btn-primary"
attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
<field name="applicant_time"/>
<field name="plan_execute_status" invisible="0"/>
<!-- <button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"-->
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>-->
<!-- <button string="撤回" name="revocation" type="object" class="btn-primary"-->
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>-->
</tree>
</field>
</record>
@@ -750,13 +756,13 @@
<field name="model">sf.cam.work.order.program.knife.plan</field>
<field name="arch" type="xml">
<form>
<header>
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"
attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
<button string="撤回" name="revocation" type="object" class="btn-primary"
attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
<field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>
</header>
<!-- <header>-->
<!-- <button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"-->
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>-->
<!-- <button string="撤回" name="revocation" type="object" class="btn-primary"-->
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>-->
<!-- <field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>-->
<!-- </header>-->
<sheet>
<div class="oe_title">
@@ -768,44 +774,34 @@
<group>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="tool_position_interface_type" placeholder="请选择"/>
<field name="production_line_id" placeholder="请选择"/>
<field name="machine_table_name_id" placeholder="请选择"/>
<field name="machine_tool_cutter_spacing_code"/>
<field name="machine_table_name"/>
<field name="cutter_spacing_code_id" placeholder="请选择"/>
<field name="whether_standard_knife"/>
<field name="need_knife_time"/>
<field name="applicant"/>
<field name="applicant_time"/>
<field name="reason_for_applying"/>
<field name="sf_functional_tool_assembly_id" string="组装单"/>
</group>
<group>
<field name="barcode_id"/>
<field name="functional_tool_name_id" placeholder="请选择"/>
<field name="barcode_id" invisible="1"/>
<field name="functional_tool_name"/>
<field name="functional_tool_type_id" placeholder="请选择"/>
<field name="diameter"/>
<field name="tool_included_angle"/>
<field name="tool_loading_length"/>
<field name="extension_length"/>
<field name="effective_length"/>
<field name="new_former"/>
<field name="coarse_middle_thin"/>
<field name="L_D"/>
<field name="clearance_length"/>
<field name="required_cutting_time"/>
</group>
</group>
<notebook>
<page string="数据信息">
<group>
<group>
<field name="diameter"/>
<field name="tool_loading_length"/>
<field name="clearance_length"/>
<field name="tool_included_angle"/>
<field name="L_D"/>
<field name="coarse_middle_thin"/>
</group>
<group>
<field name="need_knife_time" placeholder="请选择"/>
<field name="required_cutting_time"/>
<field name="whether_standard_tool"/>
<field name="applicant"/>
<field name="reason_for_applying"/>
</group>
</group>
</page>
<page string="其他">
<group>
<group>
<field name="remark"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
@@ -815,15 +811,21 @@
<field name="model">sf.cam.work.order.program.knife.plan</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="name" string="工单编码"/>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="machine_table_name_id"/>
<field name="functional_tool_name_id"/>
<field name="functional_tool_type_id"/>
<field name="machine_tool_cutter_spacing_code"/>
<field name="machine_table_name_id" invisible="1"/>
<field name="production_line_id" invisible="1"/>
<field name="machine_table_name"/>
<field name="functional_tool_name"/>
<field name="diameter"/>
<field name="tool_included_angle"/>
<field name="need_knife_time"/>
<field name="applicant"/>
<field name="applicant_time"/>
<field name="plan_execute_status" invisible="0"/>
<searchpanel>
<field name="production_line_id" string="生产线" enable_counters="1" icon="fa-filter"/>
<field name="machine_table_name_id" string="CNC机床" enable_counters="1" icon="fa-filter"/>
</searchpanel>
</search>

View File

@@ -378,7 +378,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
# 创建功能刀具批次/序列号记录
stock_lot = product_id.create_assemble_warehouse_receipt(self.id, functional_tool_assembly)
# 创建刀具组装入库单
self.create_stocking_picking(stock_lot)
self.create_stocking_picking(stock_lot, functional_tool_assembly)
# 刀具物料出库
if self.integral_code_id:
product_id.tool_material_stock_moves(self.integral_code_id)
@@ -436,7 +436,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if not self.bar_code_id and not self.pad_code_id:
raise ValidationError('【刀盘】和【刀杆】必须填写一个!')
def create_stocking_picking(self, stock_lot):
def create_stocking_picking(self, stock_lot, functional_tool_assembly):
"""
创建刀具组装入库单
"""
@@ -450,7 +450,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
self.env['stock.move.line'].create({
'picking_id': picking_id.id,
'product_id': stock_lot.product_id.id,
'lot_id': stock_lot.id
'lot_id': stock_lot.id,
'functional_tool_name_id': functional_tool_assembly.id
})
# 将刀具组装入库单的状态更改为就绪
picking_id.action_confirm()
@@ -572,7 +573,6 @@ class ProductProduct(models.Model):
"""
# 获取位置对象
location_inventory_id = tool_material.quant_ids.location_id[-1]
print(location_inventory_id)
stock_location_id = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
# 创建功能刀具该批次/序列号 库存移动和移动历史
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None)

View File

@@ -36,7 +36,8 @@
<group string="待换功能刀具信息">
<group>
<field name="replacement_tool_name" string="功能刀具名称"/>
<field name="replacement_tool_type_id" string="功能刀具类型"/>
<field name="replacement_tool_type_id" string="功能刀具类型"
options="{'no_create': True, 'no_quick_create': True}"/>
<field name="replacement_diameter" string="刀具直径(mm)"/>
<field name="replacement_knife_tip_r_angle" string="刀尖R角(mm)"/>
<field name="replacement_tool_setting_length" string="装刀长(mm)"/>
@@ -335,7 +336,8 @@
<group>
<field name="barcode_id" readonly="True"/>
<field name="after_assembly_functional_tool_name" string="功能刀具名称"/>
<field name="after_assembly_functional_tool_type_id" string="功能刀具类型"/>
<field name="after_assembly_functional_tool_type_id" string="功能刀具类型"
options="{'no_create': True, 'no_quick_create': True}"/>
<field name="after_assembly_functional_tool_diameter" string="刀具直径(mm)"/>
<field name="after_assembly_knife_tip_r_angle" string="刀尖R角(mm)"/>
<field name="after_assembly_new_former" string="新/旧"/>

View File

@@ -11,6 +11,14 @@ class SfLocation(models.Model):
name = fields.Char('Location Name', required=True, size=20)
barcode = fields.Char('Barcode', copy=False, size=15)
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
# 仓库类别selection库区、库位、货位
# location_type = fields.Selection([
# ('库区', '库区'),
@@ -218,6 +226,14 @@ class ShelfLocation(models.Model):
name = fields.Char('名称', required=True, size=20)
barcode = fields.Char('编码', copy=False, size=15)
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
# 仓库类别selection库区、库位、货位
location_type = fields.Selection([
('货架', '货架'),
@@ -258,10 +274,11 @@ class ShelfLocation(models.Model):
"""
根据货架的所属库区修改货位的所属库区
"""
all_location = self.env['sf.shelf.location'].search([('name', 'ilike', self.name)])
for record in self:
for location in all_location:
location.location_id = record.shelf_location_id.id
if self.name:
all_location = self.env['sf.shelf.location'].search([('name', 'ilike', self.name)])
for record in self:
for location in all_location:
location.location_id = record.shelf_location_id.id
@api.depends('product_sn_id')
def _compute_product_id(self):
@@ -500,3 +517,135 @@ class SfProcurementGroup(models.Model):
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]),
order='route_sequence, sequence', limit=1)
return res
class SfWarehouse(models.Model):
_inherit = 'stock.warehouse'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfRule(models.Model):
_inherit = 'stock.rule'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfRoute(models.Model):
_inherit = 'stock.route'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfPickingType(models.Model):
_inherit = 'stock.picking.type'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfProductCategory(models.Model):
_inherit = 'product.category'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfUomCategory(models.Model):
_inherit = 'uom.category'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfBarcodeNomenclature(models.Model):
_inherit = 'barcode.nomenclature'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfPutawayRule(models.Model):
_inherit = 'stock.putaway.rule'
check_state = fields.Selection([
('enable', '同意'),
('close', '不同意')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
check_state = fields.Selection([
('enable', '同意'),
('close', '不同意')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfStockQuant(models.Model):
_inherit = 'stock.quant'
check_state = fields.Selection([
('enable', '同意'),
('close', '不同意')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'
class SfStockScrap(models.Model):
_inherit = 'stock.scrap'
check_state = fields.Selection([
('enable', '启用'),
('close', '关闭')
], string='审核状态', default='close')
def action_check(self):
self.check_state = 'enable'

View File

@@ -1,5 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_stock_location,stock.location,model_stock_location,base.group_user,1,1,1,0
access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_warehouse.group_sf_stock_user,1,1,1,0
access_procurement_group,procurement.group,stock.model_procurement_group,base.group_user,1,1,1,0
access_stock_warehouse_manager,stock.warehouse.manager,stock.model_stock_warehouse,sf_warehouse.group_sf_stock_user,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_stock_location access_sf_shelf_location stock.location sf.shelf.location model_stock_location model_sf_shelf_location base.group_user sf_warehouse.group_sf_stock_user 1 1 1 0
3 access_procurement_group procurement.group stock.model_procurement_group base.group_user 1 1 1 0
4 access_stock_warehouse_manager stock.warehouse.manager stock.model_stock_warehouse sf_warehouse.group_sf_stock_user 1 1 1 0
5 access_stock_warehouse_user stock.warehouse.user stock.model_stock_warehouse base.group_user 1 0 0 0

View File

@@ -1,178 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_shelf_location_tree" model="ir.ui.view">
<field name="name">Shelf Location tree</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<tree string="Shelf Location">
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
</tree>
</field>
</record>
<data>
<record id="view_shelf_location_tree" model="ir.ui.view">
<field name="name">Shelf Location tree</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<tree string="Shelf Location">
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</tree>
</field>
</record>
<record id="view_shelf_location_form" model="ir.ui.view">
<field name="name">Shelf Location form</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<form string="Shelf Location">
<header>
<button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
</header>
<sheet>
<group>
<field name="hide_shelf" invisible="1"/>
<field name="hide_location" invisible="1"/>
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="shelf_location_id" attrs="{'invisible': [('location_type', '=', '货位')]}"/>
<field name="location_id" attrs="{'readonly': [('location_type', '=', '货位')], 'invisible': [('location_type', '=', '货')]}"/>
<field name="channel" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="direction" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_sn_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" widget="many2many_tags"/> -->
<field name="shelf_height" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="shelf_layer" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="layer_capacity" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<!-- <field name="product_id" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/> -->
<field name="product_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}" widget="many2many_tags"/> -->
<field name="location_status" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_shelf_location_form" model="ir.ui.view">
<field name="name">Shelf Location form</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<form string="Shelf Location">
<header>
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
</header>
<sheet>
<group>
<field name="hide_shelf" invisible="1"/>
<field name="hide_location" invisible="1"/>
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="shelf_location_id" attrs="{'invisible': [('location_type', '=', '货')]}"/>
<field name="location_id"
attrs="{'readonly': [('location_type', '=', '货位')], 'invisible': [('location_type', '=', '货架')]}"/>
<field name="channel"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="direction"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_sn_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" widget="many2many_tags"/> -->
<field name="shelf_height"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="shelf_layer"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="layer_capacity"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<!-- <field name="product_id" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/> -->
<field name="product_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}" widget="many2many_tags"/> -->
<field name="location_status"
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="shelf_location_kanban_view" model="ir.ui.view">
<field name="name">shelf.location.kanban</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" js_class="custom_kanban">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click
<field name="name">shelf.location.kanban</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" js_class="custom_kanban">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click
#{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''}
#{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''}
#{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}">
<!-- 标题 -->
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<field name="name"/>
<!-- 标题 -->
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<field name="name"/>
</div>
</div>
<!-- 内容 -->
<div class="o_kanban_record_bottom">
<field name="location_status"/>
</div>
<div class="o_kanban_record_bottom">
<field name="product_sn_id"/>
<span>|</span>
<field name="product_id"/>
</div>
</div>
</div>
<!-- 内容 -->
<div class="o_kanban_record_bottom">
<field name="location_status"/>
</div>
<div class="o_kanban_record_bottom">
<field name="product_sn_id"/>
<span> | </span>
<field name="product_id"/>
</div>
</div>
</t>
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- --><!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- --><!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
</templates>
</kanban>
</field>
</record>
</t>
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- --><!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- --><!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
</templates>
</kanban>
</field>
</record>
<!-- 搜索视图 -->
<record id="shelf_location_search_view" model="ir.ui.view">
<field name="name">shelf.location.search</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<search string="货架货位">
<searchpanel class="account_root">
<!-- <field name="location_type" icon="fa-filter"/> -->
<field name="location_id" select="multi" icon="fa-filter"/>
<!-- <field name="location_status" icon="fa-filter"/> -->
</searchpanel>
</search>
</field>
</record>
<!-- 搜索视图 -->
<record id="shelf_location_search_view" model="ir.ui.view">
<field name="name">shelf.location.search</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<search string="货架货位">
<searchpanel class="account_root">
<!-- <field name="location_type" icon="fa-filter"/> -->
<field name="location_id" select="multi" icon="fa-filter"/>
<!-- <field name="location_status" icon="fa-filter"/> -->
</searchpanel>
</search>
</field>
</record>
<record id="shelf_location_kanban_action_id" model="ir.actions.act_window">
<field name="name">货架货位</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">kanban,form</field>
<field name="domain">[('location_type', '=', '货位')]</field>
</record>
<record id="shelf_location_kanban_action_id" model="ir.actions.act_window">
<field name="name">货架货位</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">kanban,form</field>
<field name="domain">[('location_type', '=', '货位'),('check_state','=','enable')]</field>
</record>
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
sequence="51"
action="shelf_location_kanban_action_id"/>
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
sequence="51"
action="shelf_location_kanban_action_id"
groups="sf_warehouse.group_sf_stock_user"/>
<record id="action_sf_shelf_location" model="ir.actions.act_window">
<field name="name">货架货位</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">tree,form</field>
</record>
<record id="action_sf_shelf_location" model="ir.actions.act_window">
<field name="name">货架货位</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">tree,form</field>
</record>
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
<!-- sequence="50" -->
<!-- action="kanban_action_id"/> -->
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
<!-- sequence="50" -->
<!-- action="kanban_action_id"/> -->
<menuitem id="menu_sf_shelf_location" name="货架货位" parent="stock.menu_warehouse_config"
sequence="2"
action="action_sf_shelf_location"/>
<menuitem id="menu_sf_shelf_location" name="货架货位" parent="stock.menu_warehouse_config"
sequence="2"
action="action_sf_shelf_location"
groups="sf_warehouse.group_sf_stock_user"/>
</data>
</data>
</odoo>

View File

@@ -1,167 +1,498 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- <record id="view_location_tree2_sf_inherit" model="ir.ui.view"> -->
<!-- <field name="name">stock.location.tree.sf.inherit</field> -->
<!-- <field name="model">stock.location</field> -->
<!-- <field name="inherit_id" ref="stock.view_location_tree2"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//tree/field[@name='complete_name']" position="before"> -->
<!-- <field name="barcode"/> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<data>
<record id="view_location_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.location.form.sf.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/group" position="before">
<group string="基本信息">
<group>
<field name="hide_location_type" invisible="1"/>
<field name="hide_area" invisible="1"/>
<field name="hide_shelf" invisible="1"/>
<field name="hide_location" invisible="1"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="channel" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="direction" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_sn_id" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '空闲')]}"/>
<!-- <field name="time_test" widget="timepicker"/>-->
<field name="area_type" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
<field name="current_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
<field name="destination_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
<record id="view_location_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.location.form.sf.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/group" position="before">
<group string="基本信息">
<group>
<field name="hide_location_type" invisible="1"/>
<field name="hide_area" invisible="1"/>
<field name="hide_shelf" invisible="1"/>
<field name="hide_location" invisible="1"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="channel"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="direction"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_sn_id"
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '空闲')]}"/>
<!-- <field name="time_test" widget="timepicker"/>-->
<field name="area_type"
attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
<field name="current_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
<field name="destination_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
</group>
<group>
<!-- <field name="storage_type" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/> -->
<field name="product_type" widget="many2many_tags"
attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
<field name="shelf_height"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="shelf_layer"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="layer_capacity"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_id"
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/>
<field name="location_status"
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
</group>
</group>
<group>
<!-- <field name="storage_type" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/> -->
<field name="product_type" widget="many2many_tags" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
<field name="shelf_height" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="shelf_layer" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="layer_capacity" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_id" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/>
<field name="location_status" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
</xpath>
<!-- <xpath expr="//form/sheet/div/button" position="before"> -->
<!-- <button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/> -->
<!-- </xpath> -->
<xpath expr="//form/sheet" position="before">
<header>
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
</header>
</xpath>
<xpath expr="//form/sheet/group[last()]">
<notebook position="after" attrs="{'invisible': [('hide_area', '=', False)]}">
<page string="库存信息">
<field name="quant_ids" widget="one2many_list" context="{'location': active_id}"/>
</page>
</notebook>
</xpath>
</group>
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</group>
</xpath>
<!-- <xpath expr="//form/sheet/div/button" position="before"> -->
<!-- <button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/> -->
<!-- </xpath> -->
<xpath expr="//form/sheet" position="before">
<header>
<button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
</header>
</xpath>
<xpath expr="//form/sheet/group[last()]">
<notebook position="after" attrs="{'invisible': [('hide_area', '=', False)]}">
<page string="库存信息">
<field name="quant_ids" widget="one2many_list" context="{'location': active_id}"/>
</page>
</notebook>
</xpath>
</field>
</record>
</xpath>
</field>
</record>
<record id="view_location_search_sf_inherit" model="ir.ui.view">
<field name="name">stock.location.search.sf.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_search"/>
<field name="arch" type="xml">
<xpath expr="//search[1]" position="inside">
<searchpanel class="account_root">
<!-- <field name="location_type" icon="fa-filter"/> -->
<field name="location_id" select="multi" domain="[('location_type', '=', '货架')]"/>
</searchpanel>
</xpath>
</field>
</record>
<record id="example_kanban_view" model="ir.ui.view">
<field name="name">example.kanban</field>
<field name="model">stock.location</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" js_class="custom_kanban">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click
<record id="view_location_search_sf_inherit" model="ir.ui.view">
<field name="name">stock.location.search.sf.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_search"/>
<field name="arch" type="xml">
<xpath expr="//search[1]" position="inside">
<searchpanel class="account_root">
<!-- <field name="location_type" icon="fa-filter"/> -->
<field name="location_id" select="multi" domain="[('location_type', '=', '货架')]"/>
</searchpanel>
</xpath>
</field>
</record>
<record id="example_kanban_view" model="ir.ui.view">
<field name="name">example.kanban</field>
<field name="model">stock.location</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" js_class="custom_kanban">
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click
#{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''}
#{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''}
#{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}">
<!-- 标题 -->
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<field name="name"/>
<!-- 标题 -->
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<field name="name"/>
</div>
</div>
<!-- 内容 -->
<div class="o_kanban_record_bottom">
<field name="location_status"/>
</div>
<div class="o_kanban_record_bottom">
<field name="product_sn_id"/>
<span>|</span>
<field name="product_id"/>
</div>
</div>
</div>
<!-- 内容 -->
<div class="o_kanban_record_bottom">
<field name="location_status"/>
</div>
<div class="o_kanban_record_bottom">
<field name="product_sn_id"/>
<span> | </span>
<field name="product_id"/>
</div>
</div>
</t>
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- --><!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- --><!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
</templates>
</kanban>
</field>
</record>
</t>
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- --><!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- --><!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
</templates>
</kanban>
</field>
</record>
<record id="kanban_action_id" model="ir.actions.act_window">
<field name="name">货位状态</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.location</field>
<field name="view_mode">kanban,form</field>
</record>
<record id="kanban_action_id" model="ir.actions.act_window">
<field name="name">货位状态</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.location</field>
<field name="view_mode">kanban,form</field>
</record>
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<!-- <record id="example_action" model="ir.actions.act_window"> -->
<!-- <field name="name">Example</field> -->
<!-- <field name="type">ir.actions.act_window</field> -->
<!-- <field name="res_model">stock.location</field> -->
<!-- <field name="view_mode">kanban</field> -->
<!-- <field name="searchpanel">true</field> -->
<!-- <field name="searchpanel_field_label">货架</field> -->
<!-- <field name="searchpanel_field_name">parent_id</field> -->
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
<!-- </record> -->
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
<!-- sequence="50" -->
<!-- action="kanban_action_id"/> -->
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
<!-- sequence="50" -->
<!-- action="kanban_action_id"/> -->
<record id="view_location_tree2_sf_inherit" model="ir.ui.view">
<field name="name">stock.location.tree.sf.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_tree2"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--仓库根据权限增加审核按钮-->
<record id="view_warehouse_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.warehouse.form.sf.inherit</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_warehouse_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.warehouse.tree.sf.inherit</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
</data>
<!--路线根据权限增加审核按钮-->
<record id="view_route_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.route.form.sf.inherit</field>
<field name="model">stock.route</field>
<field name="inherit_id" ref="stock.stock_location_route_form_view"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_route_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.route.tree.sf.inherit</field>
<field name="model">stock.route</field>
<field name="inherit_id" ref="stock.stock_location_route_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--规则根据权限增加审核按钮-->
<record id="view_rule_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.rule.form.sf.inherit</field>
<field name="model">stock.rule</field>
<field name="inherit_id" ref="stock.view_stock_rule_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_rule_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.rule.tree.sf.inherit</field>
<field name="model">stock.rule</field>
<field name="inherit_id" ref="stock.view_stock_rule_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--作业类型根据权限增加审核按钮-->
<record id="view_picking_type_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.picking.type.form.sf.inherit</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_picking_type_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.picking.type.tree.sf.inherit</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--产品类别根据权限增加审核按钮-->
<record id="view_product_category_form_sf_inherit" model="ir.ui.view">
<field name="name">product.category.form.sf.inherit</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_product_category_tree_sf_inherit" model="ir.ui.view">
<field name="name">product.category.tree.sf.inherit</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_list_view"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--计量单位类别根据权限增加审核按钮-->
<record id="view_uom_category_form_sf_inherit" model="ir.ui.view">
<field name="name">uom.category.form.sf.inherit</field>
<field name="model">uom.category</field>
<field name="inherit_id" ref="uom.product_uom_categ_form_view"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_uom_category_tree_sf_inherit" model="ir.ui.view">
<field name="name">uom.category.tree.sf.inherit</field>
<field name="model">uom.category</field>
<field name="inherit_id" ref="uom.product_uom_categ_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--条码命名规则根据权限增加审核按钮-->
<record id="view_barcode_nomenclature_form_sf_inherit" model="ir.ui.view">
<field name="name">barcode.nomenclature.form.sf.inherit</field>
<field name="model">barcode.nomenclature</field>
<field name="inherit_id" ref="barcodes.view_barcode_nomenclature_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_barcode_nomenclature_tree_sf_inherit" model="ir.ui.view">
<field name="name">barcode.nomenclature.tree.sf.inherit</field>
<field name="model">barcode.nomenclature</field>
<field name="inherit_id" ref="barcodes.view_barcode_nomenclature_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
<!--上架规则根据权限增加审核按钮-->
<record id="view_putaway_rule_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.putaway.rule.tree.sf.inherit</field>
<field name="model">stock.putaway.rule</field>
<field name="inherit_id" ref="stock.stock_putaway_list"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</xpath>
</field>
</record>
<!--重订货规则根据权限增加审核按钮-->
<record id="view_warehouse_orderpoint_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree.sf.inherit</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</xpath>
</field>
</record>
<!--库存调整根据权限增加审核按钮-->
<record id="view_quant_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.quant.tree.sf.inherit</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</xpath>
</field>
</record>
<!--报废单根据权限增加审核按钮-->
<record id="view_stock_scrap_form_sf_inherit" model="ir.ui.view">
<field name="name">stock.scrap.form.sf.inherit</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<field name="check_state" invisible="1"/>
<button name="action_check" string="审核" type="object"
attrs="{'invisible': [('check_state','=', 'enable')]}"
groups="sf_warehouse.group_sf_stock_manager"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
<record id="view_stock_scrap_tree_sf_inherit" model="ir.ui.view">
<field name="name">stock.scrap.tree.sf.inherit</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[last()]" position="after">
<field name="check_state" widget="label_selection"
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
</xpath>
</field>
</record>
</data>
</odoo>