Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/权限去掉继承
This commit is contained in:
@@ -4,7 +4,7 @@ csv_internal_sep = ,
|
|||||||
data_dir = /var/lib/odoo
|
data_dir = /var/lib/odoo
|
||||||
db_host = 172.17.0.2
|
db_host = 172.17.0.2
|
||||||
db_maxconn = 64
|
db_maxconn = 64
|
||||||
db_name = sf_cs937
|
db_name = sf_t2cs_001
|
||||||
db_password = sf
|
db_password = sf
|
||||||
db_port = 5432
|
db_port = 5432
|
||||||
db_sslmode = prefer
|
db_sslmode = prefer
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cpca
|
|||||||
# from odoo.exceptions import UserError
|
# from odoo.exceptions import UserError
|
||||||
# from odoo.exceptions import ValidationError
|
# from odoo.exceptions import ValidationError
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -60,38 +61,46 @@ class JdEclp(models.Model):
|
|||||||
|
|
||||||
@api.depends('origin')
|
@api.depends('origin')
|
||||||
def _truck_info(self):
|
def _truck_info(self):
|
||||||
|
"""
|
||||||
|
根据销售订单号,获取收货人信息
|
||||||
|
"""
|
||||||
# if 'S' in self.origin:
|
# if 'S' in self.origin:
|
||||||
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
|
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
|
||||||
# self.receiverCountyName and self.receiverTownName:
|
# self.receiverCountyName and self.receiverTownName:
|
||||||
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||||
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
||||||
# if sale_order_id.address_of_delivery != False:
|
# if sale_order_id.address_of_delivery != False:
|
||||||
|
# if not sale_order_id:
|
||||||
|
# raise ValidationError("找不到对应的销售订单")
|
||||||
try:
|
try:
|
||||||
if 'OUT' in self.name:
|
if 'OUT' in self.name and sale_order_id.address_of_delivery:
|
||||||
raw_addres = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
|
raw_address = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
|
||||||
# _logger.info('=================dddd====', sale_order_id.address_of_delivery)
|
if sale_order_id.person_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.receiverName = sale_order_id.person_of_delivery
|
||||||
|
if sale_order_id.telephone_of_delivery:
|
||||||
self.receiverMobile = sale_order_id.telephone_of_delivery
|
self.receiverMobile = sale_order_id.telephone_of_delivery
|
||||||
self.receiverProvinceName = cpca.transform(raw_addres).values.tolist()[0][0]
|
if raw_address:
|
||||||
self.receiverCityName = cpca.transform(raw_addres).values.tolist()[0][1]
|
self.receiverProvinceName = cpca.transform(raw_address).values.tolist()[0][0]
|
||||||
self.receiverCountyName = cpca.transform(raw_addres).values.tolist()[0][2]
|
self.receiverCityName = cpca.transform(raw_address).values.tolist()[0][1]
|
||||||
self.receiverTownName = cpca.transform(raw_addres).values.tolist()[0][3]
|
self.receiverCountyName = cpca.transform(raw_address).values.tolist()[0][2]
|
||||||
|
self.receiverTownName = cpca.transform(raw_address).values.tolist()[0][3]
|
||||||
else:
|
else:
|
||||||
self.receiverName = self.receiverName
|
self.receiverName = False
|
||||||
self.receiverMobile = self.receiverMobile
|
self.receiverMobile = False
|
||||||
self.receiverProvinceName = self.receiverProvinceName
|
self.receiverProvinceName = False
|
||||||
self.receiverCityName = self.receiverCityName
|
self.receiverCityName = False
|
||||||
self.receiverCountyName = self.receiverCountyName
|
self.receiverCountyName = False
|
||||||
self.receiverTownName = self.receiverTownName
|
self.receiverTownName = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error address is none: {e}")
|
raise ValidationError(f"传值有误: {e}")
|
||||||
|
|
||||||
def create_order(self):
|
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)])
|
# sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||||
|
|
||||||
# if self.carrier_id == '京东物流':
|
# 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()
|
config = self.env['res.config.settings'].get_values()
|
||||||
json1 = {
|
json1 = {
|
||||||
'params': {
|
'params': {
|
||||||
|
|||||||
@@ -873,13 +873,3 @@ class SfMaintenanceEquipmentTool(models.Model):
|
|||||||
for record in self:
|
for record in self:
|
||||||
if record.code:
|
if record.code:
|
||||||
record.name = 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
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class MrStaticResourceDataSync(models.Model):
|
|||||||
# logging.info("材料型号已每日同步成功")
|
# logging.info("材料型号已每日同步成功")
|
||||||
# self.env['mrs.international.standards']._cron_mrs_international_standards_func()
|
# self.env['mrs.international.standards']._cron_mrs_international_standards_func()
|
||||||
# logging.info("材料型号材料应用已每日同步成功")
|
# logging.info("材料型号材料应用已每日同步成功")
|
||||||
self.env['material.apply']._cron_material_apply_func()
|
self.env['material.apply'].sync_material_apply()
|
||||||
logging.info("材料型号材料应用已每日同步成功")
|
logging.info("材料型号材料应用已每日同步成功")
|
||||||
self.env['sf.production.process.category'].sync_production_process_category_yesterday()
|
self.env['sf.production.process.category'].sync_production_process_category_yesterday()
|
||||||
logging.info("表面工艺类别已每日同步成功")
|
logging.info("表面工艺类别已每日同步成功")
|
||||||
|
|||||||
@@ -40,6 +40,8 @@
|
|||||||
name="open_work_schedule_calendar"
|
name="open_work_schedule_calendar"
|
||||||
class="oe_highlight"
|
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="正常,禁用"/>
|
<field name="status" widget="statusbar" statusbar_visible="正常,禁用"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet string-="工作日历设置">
|
<sheet string-="工作日历设置">
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
'author': 'jikimo',
|
'author': 'jikimo',
|
||||||
'website': 'https://sf.cs.jikimo.com',
|
'website': 'https://sf.cs.jikimo.com',
|
||||||
# 此处依赖sf_manufacturing是因为我要重写其中的一个字段operation_id的string,故需要sf_manufacturing先安装
|
# 此处依赖sf_manufacturing是因为我要重写其中的一个字段operation_id的string,故需要sf_manufacturing先安装
|
||||||
'depends': ['quality_control'],
|
'depends': ['quality_control', 'sf_maintenance'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/view.xml'
|
'views/view.xml'
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
# -*-coding:utf-8-*-
|
# -*-coding:utf-8-*-
|
||||||
from . import models
|
from . import models
|
||||||
from . import wizard
|
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()
|
||||||
|
|||||||
8
sf_tool_management/data/tool_data.xml
Normal file
8
sf_tool_management/data/tool_data.xml
Normal 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>
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
from . import base
|
from . import base
|
||||||
from . import tool_material_search
|
from . import tool_material_search
|
||||||
|
from . import maintenance_equipment
|
||||||
|
|
||||||
|
|||||||
@@ -41,13 +41,10 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
def _compute_current_location_id(self):
|
def _compute_current_location_id(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.barcode_id.quant_ids:
|
if record.barcode_id.quant_ids:
|
||||||
print(record.barcode_id.quant_ids)
|
|
||||||
for quant_id in record.barcode_id.quant_ids:
|
for quant_id in record.barcode_id.quant_ids:
|
||||||
if quant_id.inventory_quantity_auto_apply > 0:
|
if quant_id.inventory_quantity_auto_apply > 0:
|
||||||
print(quant_id)
|
|
||||||
record.current_location_id = quant_id.location_id
|
record.current_location_id = quant_id.location_id
|
||||||
record.current_location = quant_id.location_id.name
|
record.current_location = quant_id.location_id.name
|
||||||
print(record.current_location_id)
|
|
||||||
if record.current_location_id:
|
if record.current_location_id:
|
||||||
record.get_location_num()
|
record.get_location_num()
|
||||||
else:
|
else:
|
||||||
@@ -161,7 +158,7 @@ class FunctionalToolWarning(models.Model):
|
|||||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||||
group_expand='_read_group_machine_table_name_ids')
|
group_expand='_read_group_machine_table_name_ids')
|
||||||
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='CNC机床')
|
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='机床类型')
|
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型')
|
||||||
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号',
|
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号',
|
||||||
domain="[('equipment_id', '=', maintenance_equipment_id)]")
|
domain="[('equipment_id', '=', maintenance_equipment_id)]")
|
||||||
@@ -222,7 +219,7 @@ class StockMoveLine(models.Model):
|
|||||||
related='functional_tool_name_id.functional_tool_type_id')
|
related='functional_tool_name_id.functional_tool_type_id')
|
||||||
diameter = fields.Integer(string='刀具直径(mm)', related='functional_tool_name_id.functional_tool_diameter')
|
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')
|
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
|
@api.model
|
||||||
def _read_group_functional_tool_type_id(self, categories, domain, order):
|
def _read_group_functional_tool_type_id(self, categories, domain, order):
|
||||||
@@ -339,7 +336,7 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
group_expand='_read_group_names')
|
group_expand='_read_group_names')
|
||||||
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
|
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
|
||||||
compute='_compute_machine_table_type_id')
|
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,
|
cutter_spacing_code_id = fields.Many2one('maintenance.equipment.tool', string='刀位号', readonly=True,
|
||||||
required=True, domain="[('equipment_id', '=', maintenance_equipment_id)]")
|
required=True, domain="[('equipment_id', '=', maintenance_equipment_id)]")
|
||||||
# 功能刀具信息
|
# 功能刀具信息
|
||||||
@@ -355,7 +352,7 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
[('BT刀柄式', 'BT刀柄式'), ('SK刀柄式', 'SK刀柄式'), ('HSK刀柄式', 'HSK刀柄式'),
|
[('BT刀柄式', 'BT刀柄式'), ('SK刀柄式', 'SK刀柄式'), ('HSK刀柄式', 'HSK刀柄式'),
|
||||||
('CAT刀柄式', 'CAT刀柄式'), ('ISO刀盘式', 'ISO刀盘式'), ('DIN刀盘式', 'DIN刀盘式'),
|
('CAT刀柄式', 'CAT刀柄式'), ('ISO刀盘式', 'ISO刀盘式'), ('DIN刀盘式', 'DIN刀盘式'),
|
||||||
('直装固定式', '直装固定式')], string='刀位接口型号')
|
('直装固定式', '直装固定式')], string='刀位接口型号')
|
||||||
diameter = fields.Integer(string='刀具直径(mm)', )
|
diameter = fields.Integer(string='刀具直径(mm)')
|
||||||
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)')
|
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)')
|
||||||
max_lifetime_value = fields.Integer(string='最大寿命值(min)')
|
max_lifetime_value = fields.Integer(string='最大寿命值(min)')
|
||||||
alarm_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(
|
self.env['sf.machine.table.tool.changing.apply'].search(
|
||||||
[('name', '=', self.name.id)]).write({'status': '0'})
|
[('name', '=', self.name.id)]).write({'status': '0'})
|
||||||
|
|
||||||
|
def create_tool_change_application(self):
|
||||||
|
print("调用了create_tool_change_application()")
|
||||||
|
|
||||||
|
|
||||||
class CAMWorkOrderProgramKnifePlan(models.Model):
|
class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||||
_name = 'sf.cam.work.order.program.knife.plan'
|
_name = 'sf.cam.work.order.program.knife.plan'
|
||||||
@@ -487,39 +487,49 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
|||||||
name = fields.Char(string='工单任务编号', readonly=False)
|
name = fields.Char(string='工单任务编号', readonly=False)
|
||||||
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
|
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
|
||||||
cam_cutter_spacing_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='功能刀具序列号',
|
barcode_id = fields.Many2one('stock.lot', string='功能刀具序列号',
|
||||||
domain=[('product_id.name', '=', '功能刀具')])
|
domain=[('product_id.name', '=', '功能刀具')])
|
||||||
functional_tool_name_id = fields.Many2one('product.product', string='功能刀具名称',
|
functional_tool_name = fields.Char(string='功能刀具名称', required=True)
|
||||||
domain=[('name', '=', '功能刀具')])
|
|
||||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
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,
|
diameter = fields.Integer(string='刀具直径(mm)', readonly=False)
|
||||||
group_expand='_read_group_machine_table_name_ids')
|
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', '已完成')],
|
plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')],
|
||||||
string='计划执行状态', default='0', readonly=False)
|
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)
|
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):
|
def apply_for_tooling(self):
|
||||||
"""
|
"""
|
||||||
申请装刀
|
申请装刀
|
||||||
|
|||||||
15
sf_tool_management/models/maintenance_equipment.py
Normal file
15
sf_tool_management/models/maintenance_equipment.py
Normal 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
|
||||||
@@ -347,11 +347,13 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="走刀方向">
|
<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)]"/>
|
domain="[('id','in',cutting_direction_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="适合冷却液">
|
<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)]"/>
|
domain="[('id','in',suitable_coolant_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
@@ -478,7 +480,7 @@
|
|||||||
<tree create="0" delete="0">
|
<tree create="0" delete="0">
|
||||||
<field name="name" invisible="1"/>
|
<field name="name" invisible="1"/>
|
||||||
<field name="production_line_id" 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="machine_tool_code"/>
|
||||||
<field name="cutter_spacing_code_id"/>
|
<field name="cutter_spacing_code_id"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="functional_tool_name_id"/>
|
||||||
@@ -531,7 +533,7 @@
|
|||||||
'default_replacement_extension_length': extension_length,
|
'default_replacement_extension_length': extension_length,
|
||||||
'default_replacement_effective_length': effective_length,
|
'default_replacement_effective_length': effective_length,
|
||||||
}"
|
}"
|
||||||
attrs="{'invisible': [('status', '!=', '0')]}"
|
attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
/>
|
/>
|
||||||
<button string="转移"
|
<button string="转移"
|
||||||
@@ -557,7 +559,7 @@
|
|||||||
'default_effective_length': effective_length,
|
'default_effective_length': effective_length,
|
||||||
}"
|
}"
|
||||||
class="btn-primary"
|
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"
|
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary"
|
||||||
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
||||||
@@ -605,7 +607,7 @@
|
|||||||
'default_replacement_extension_length': extension_length,
|
'default_replacement_extension_length': extension_length,
|
||||||
'default_replacement_effective_length': effective_length,
|
'default_replacement_effective_length': effective_length,
|
||||||
}"
|
}"
|
||||||
attrs="{'invisible': [('status', '!=', '0')]}"
|
attrs="{'invisible': ['|',('status', '!=', '0'), ('functional_tool_name_id', '=', False)]}"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
/>
|
/>
|
||||||
<button string="转移"
|
<button string="转移"
|
||||||
@@ -631,7 +633,7 @@
|
|||||||
'default_effective_length': effective_length,
|
'default_effective_length': effective_length,
|
||||||
}"
|
}"
|
||||||
class="btn-primary"
|
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"
|
<button string="撤回换刀申请" name="revocation_1" type="object" class="btn-primary"
|
||||||
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
attrs="{'invisible': [('status', '!=', '1')]}" confirm="是否确认撤回换刀申请"/>
|
||||||
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary"
|
<button string="撤回转移" name="revocation_2" type="object" class="btn-primary"
|
||||||
@@ -663,7 +665,8 @@
|
|||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="barcode_id"/>
|
<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="functional_tool_type_id"/>
|
||||||
<field name="diameter"/>
|
<field name="diameter"/>
|
||||||
<field name="knife_tip_r_angle"/>
|
<field name="knife_tip_r_angle"/>
|
||||||
@@ -727,20 +730,23 @@
|
|||||||
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name" string="工单编码"/>
|
||||||
<field name="cam_procedure_code"/>
|
<field name="cam_procedure_code"/>
|
||||||
<field name="cam_cutter_spacing_code"/>
|
<field name="cam_cutter_spacing_code"/>
|
||||||
<field name="machine_table_name_id"/>
|
<field name="production_line_id" invisible="1"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="machine_table_name_id" invisible="1"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="machine_table_name"/>
|
||||||
<field name="machine_tool_cutter_spacing_code"/>
|
<field name="functional_tool_name"/>
|
||||||
|
<field name="diameter"/>
|
||||||
|
<field name="tool_included_angle"/>
|
||||||
|
<field name="need_knife_time"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
<field name="remark" optional="hide"/>
|
<field name="applicant_time"/>
|
||||||
<field name="plan_execute_status" invisible="True"/>
|
<field name="plan_execute_status" invisible="0"/>
|
||||||
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"
|
<!-- <button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"-->
|
||||||
attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>-->
|
||||||
<button string="撤回" name="revocation" type="object" class="btn-primary"
|
<!-- <button string="撤回" name="revocation" type="object" class="btn-primary"-->
|
||||||
attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>-->
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -750,13 +756,13 @@
|
|||||||
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form>
|
||||||
<header>
|
<!-- <header>-->
|
||||||
<button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"
|
<!-- <button string="申请装刀" name="apply_for_tooling" type="object" class="btn-primary"-->
|
||||||
attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>
|
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '0')]}" confirm="是否确认申请装刀"/>-->
|
||||||
<button string="撤回" name="revocation" type="object" class="btn-primary"
|
<!-- <button string="撤回" name="revocation" type="object" class="btn-primary"-->
|
||||||
attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>
|
<!-- attrs="{'invisible': [('plan_execute_status', '!=', '1')]}" confirm="是否确认撤回装刀"/>-->
|
||||||
<field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>
|
<!-- <field name="plan_execute_status" widget="statusbar" statusbar_visible="0,1,2"/>-->
|
||||||
</header>
|
<!-- </header>-->
|
||||||
|
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
@@ -768,44 +774,34 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="cam_procedure_code"/>
|
<field name="cam_procedure_code"/>
|
||||||
<field name="cam_cutter_spacing_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_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="组装单"/>
|
<field name="sf_functional_tool_assembly_id" string="组装单"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="barcode_id"/>
|
<field name="barcode_id" invisible="1"/>
|
||||||
<field name="functional_tool_name_id" placeholder="请选择"/>
|
<field name="functional_tool_name"/>
|
||||||
<field name="functional_tool_type_id" placeholder="请选择"/>
|
<field name="functional_tool_type_id" placeholder="请选择"/>
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
<notebook>
|
|
||||||
<page string="数据信息">
|
|
||||||
<group>
|
|
||||||
<group>
|
|
||||||
<field name="diameter"/>
|
<field name="diameter"/>
|
||||||
<field name="tool_loading_length"/>
|
|
||||||
<field name="clearance_length"/>
|
|
||||||
<field name="tool_included_angle"/>
|
<field name="tool_included_angle"/>
|
||||||
<field name="L_D"/>
|
<field name="tool_loading_length"/>
|
||||||
|
<field name="extension_length"/>
|
||||||
|
<field name="effective_length"/>
|
||||||
|
<field name="new_former"/>
|
||||||
<field name="coarse_middle_thin"/>
|
<field name="coarse_middle_thin"/>
|
||||||
</group>
|
<field name="L_D"/>
|
||||||
<group>
|
<field name="clearance_length"/>
|
||||||
<field name="need_knife_time" placeholder="请选择"/>
|
|
||||||
<field name="required_cutting_time"/>
|
<field name="required_cutting_time"/>
|
||||||
<field name="whether_standard_tool"/>
|
|
||||||
<field name="applicant"/>
|
|
||||||
<field name="reason_for_applying"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
|
||||||
<page string="其他">
|
|
||||||
<group>
|
|
||||||
<group>
|
|
||||||
<field name="remark"/>
|
|
||||||
</group>
|
|
||||||
</group>
|
|
||||||
</page>
|
|
||||||
</notebook>
|
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
@@ -815,15 +811,21 @@
|
|||||||
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
<field name="model">sf.cam.work.order.program.knife.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<field name="name"/>
|
<field name="name" string="工单编码"/>
|
||||||
<field name="cam_procedure_code"/>
|
<field name="cam_procedure_code"/>
|
||||||
<field name="cam_cutter_spacing_code"/>
|
<field name="cam_cutter_spacing_code"/>
|
||||||
<field name="machine_table_name_id"/>
|
<field name="machine_table_name_id" invisible="1"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="production_line_id" invisible="1"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="machine_table_name"/>
|
||||||
<field name="machine_tool_cutter_spacing_code"/>
|
<field name="functional_tool_name"/>
|
||||||
|
<field name="diameter"/>
|
||||||
|
<field name="tool_included_angle"/>
|
||||||
|
<field name="need_knife_time"/>
|
||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
|
<field name="applicant_time"/>
|
||||||
|
<field name="plan_execute_status" invisible="0"/>
|
||||||
<searchpanel>
|
<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"/>
|
<field name="machine_table_name_id" string="CNC机床" enable_counters="1" icon="fa-filter"/>
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
</search>
|
</search>
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# 创建功能刀具批次/序列号记录
|
# 创建功能刀具批次/序列号记录
|
||||||
stock_lot = product_id.create_assemble_warehouse_receipt(self.id, functional_tool_assembly)
|
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:
|
if self.integral_code_id:
|
||||||
product_id.tool_material_stock_moves(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:
|
if not self.bar_code_id and not self.pad_code_id:
|
||||||
raise ValidationError('【刀盘】和【刀杆】必须填写一个!')
|
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({
|
self.env['stock.move.line'].create({
|
||||||
'picking_id': picking_id.id,
|
'picking_id': picking_id.id,
|
||||||
'product_id': stock_lot.product_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()
|
picking_id.action_confirm()
|
||||||
@@ -572,7 +573,6 @@ class ProductProduct(models.Model):
|
|||||||
"""
|
"""
|
||||||
# 获取位置对象
|
# 获取位置对象
|
||||||
location_inventory_id = tool_material.quant_ids.location_id[-1]
|
location_inventory_id = tool_material.quant_ids.location_id[-1]
|
||||||
print(location_inventory_id)
|
|
||||||
stock_location_id = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
|
stock_location_id = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
|
||||||
# 创建功能刀具该批次/序列号 库存移动和移动历史
|
# 创建功能刀具该批次/序列号 库存移动和移动历史
|
||||||
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None)
|
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None)
|
||||||
|
|||||||
@@ -36,7 +36,8 @@
|
|||||||
<group string="待换功能刀具信息">
|
<group string="待换功能刀具信息">
|
||||||
<group>
|
<group>
|
||||||
<field name="replacement_tool_name" string="功能刀具名称"/>
|
<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_diameter" string="刀具直径(mm)"/>
|
||||||
<field name="replacement_knife_tip_r_angle" string="刀尖R角(mm)"/>
|
<field name="replacement_knife_tip_r_angle" string="刀尖R角(mm)"/>
|
||||||
<field name="replacement_tool_setting_length" string="装刀长(mm)"/>
|
<field name="replacement_tool_setting_length" string="装刀长(mm)"/>
|
||||||
@@ -335,7 +336,8 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="barcode_id" readonly="True"/>
|
<field name="barcode_id" readonly="True"/>
|
||||||
<field name="after_assembly_functional_tool_name" string="功能刀具名称"/>
|
<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_functional_tool_diameter" string="刀具直径(mm)"/>
|
||||||
<field name="after_assembly_knife_tip_r_angle" string="刀尖R角(mm)"/>
|
<field name="after_assembly_knife_tip_r_angle" string="刀尖R角(mm)"/>
|
||||||
<field name="after_assembly_new_former" string="新/旧"/>
|
<field name="after_assembly_new_former" string="新/旧"/>
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ class SfLocation(models.Model):
|
|||||||
name = fields.Char('Location Name', required=True, size=20)
|
name = fields.Char('Location Name', required=True, size=20)
|
||||||
barcode = fields.Char('Barcode', copy=False, size=15)
|
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:库区、库位、货位)
|
# 仓库类别(selection:库区、库位、货位)
|
||||||
# location_type = fields.Selection([
|
# location_type = fields.Selection([
|
||||||
# ('库区', '库区'),
|
# ('库区', '库区'),
|
||||||
@@ -218,6 +226,14 @@ class ShelfLocation(models.Model):
|
|||||||
name = fields.Char('名称', required=True, size=20)
|
name = fields.Char('名称', required=True, size=20)
|
||||||
barcode = fields.Char('编码', copy=False, size=15)
|
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:库区、库位、货位)
|
# 仓库类别(selection:库区、库位、货位)
|
||||||
location_type = fields.Selection([
|
location_type = fields.Selection([
|
||||||
('货架', '货架'),
|
('货架', '货架'),
|
||||||
@@ -258,6 +274,7 @@ class ShelfLocation(models.Model):
|
|||||||
"""
|
"""
|
||||||
根据货架的所属库区修改货位的所属库区
|
根据货架的所属库区修改货位的所属库区
|
||||||
"""
|
"""
|
||||||
|
if self.name:
|
||||||
all_location = self.env['sf.shelf.location'].search([('name', 'ilike', self.name)])
|
all_location = self.env['sf.shelf.location'].search([('name', 'ilike', self.name)])
|
||||||
for record in self:
|
for record in self:
|
||||||
for location in all_location:
|
for location in all_location:
|
||||||
@@ -500,3 +517,135 @@ class SfProcurementGroup(models.Model):
|
|||||||
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]),
|
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]),
|
||||||
order='route_sequence, sequence', limit=1)
|
order='route_sequence, sequence', limit=1)
|
||||||
return res
|
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'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
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_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
|
access_stock_warehouse_manager,stock.warehouse.manager,stock.model_stock_warehouse,sf_warehouse.group_sf_stock_user,1,1,1,0
|
||||||
|
|||||||
|
@@ -9,6 +9,12 @@
|
|||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="barcode" string="编码"/>
|
<field name="barcode" string="编码"/>
|
||||||
<field name="location_type"/>
|
<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>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -19,7 +25,8 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Shelf Location">
|
<form string="Shelf Location">
|
||||||
<header>
|
<header>
|
||||||
<button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
||||||
|
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
@@ -29,18 +36,25 @@
|
|||||||
<field name="barcode" string="编码"/>
|
<field name="barcode" string="编码"/>
|
||||||
<field name="location_type"/>
|
<field name="location_type"/>
|
||||||
<field name="shelf_location_id" attrs="{'invisible': [('location_type', '=', '货位')]}"/>
|
<field name="shelf_location_id" attrs="{'invisible': [('location_type', '=', '货位')]}"/>
|
||||||
<field name="location_id" attrs="{'readonly': [('location_type', '=', '货位')], 'invisible': [('location_type', '=', '货架')]}"/>
|
<field name="location_id"
|
||||||
<field name="channel" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
attrs="{'readonly': [('location_type', '=', '货位')], 'invisible': [('location_type', '=', '货架')]}"/>
|
||||||
<field name="direction" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
<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_sn_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
|
||||||
<!-- <field name="product_type" widget="many2many_tags"/> -->
|
<!-- <field name="product_type" widget="many2many_tags"/> -->
|
||||||
<field name="shelf_height" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
<field name="shelf_height"
|
||||||
<field name="shelf_layer" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
||||||
<field name="layer_capacity" 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)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/> -->
|
||||||
<field name="product_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
|
<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="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)]}"/>
|
<field name="location_status"
|
||||||
|
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
@@ -125,7 +139,7 @@
|
|||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sf.shelf.location</field>
|
<field name="res_model">sf.shelf.location</field>
|
||||||
<field name="view_mode">kanban,form</field>
|
<field name="view_mode">kanban,form</field>
|
||||||
<field name="domain">[('location_type', '=', '货位')]</field>
|
<field name="domain">[('location_type', '=', '货位'),('check_state','=','enable')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
||||||
@@ -143,7 +157,8 @@
|
|||||||
|
|
||||||
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
|
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
|
||||||
sequence="51"
|
sequence="51"
|
||||||
action="shelf_location_kanban_action_id"/>
|
action="shelf_location_kanban_action_id"
|
||||||
|
groups="sf_warehouse.group_sf_stock_user"/>
|
||||||
|
|
||||||
<record id="action_sf_shelf_location" model="ir.actions.act_window">
|
<record id="action_sf_shelf_location" model="ir.actions.act_window">
|
||||||
<field name="name">货架货位</field>
|
<field name="name">货架货位</field>
|
||||||
@@ -171,7 +186,8 @@
|
|||||||
|
|
||||||
<menuitem id="menu_sf_shelf_location" name="货架货位" parent="stock.menu_warehouse_config"
|
<menuitem id="menu_sf_shelf_location" name="货架货位" parent="stock.menu_warehouse_config"
|
||||||
sequence="2"
|
sequence="2"
|
||||||
action="action_sf_shelf_location"/>
|
action="action_sf_shelf_location"
|
||||||
|
groups="sf_warehouse.group_sf_stock_user"/>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1,16 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<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> -->
|
|
||||||
|
|
||||||
<record id="view_location_form_sf_inherit" model="ir.ui.view">
|
<record id="view_location_form_sf_inherit" model="ir.ui.view">
|
||||||
<field name="name">stock.location.form.sf.inherit</field>
|
<field name="name">stock.location.form.sf.inherit</field>
|
||||||
@@ -27,23 +18,33 @@
|
|||||||
<field name="hide_location" invisible="1"/>
|
<field name="hide_location" invisible="1"/>
|
||||||
<field name="barcode" string="编码"/>
|
<field name="barcode" string="编码"/>
|
||||||
<field name="location_type"/>
|
<field name="location_type"/>
|
||||||
<field name="channel" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
<field name="channel"
|
||||||
<field name="direction" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
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="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="time_test" widget="timepicker"/>-->
|
||||||
<field name="area_type" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
|
<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="current_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
|
||||||
<field name="destination_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
|
<field name="destination_location_id" attrs="{'invisible': [('hide_area', '=', False)]}"/>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<!-- <field name="storage_type" attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/> -->
|
<!-- <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="product_type" widget="many2many_tags"
|
||||||
<field name="shelf_height" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
attrs="{'invisible': [('hide_area', '=', False)], 'required': [('hide_area', '!=', False)]}"/>
|
||||||
<field name="shelf_layer" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
<field name="shelf_height"
|
||||||
<field name="layer_capacity" attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
|
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="shelf_layer"
|
||||||
<field name="location_status" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
|
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>
|
||||||
|
|
||||||
@@ -54,7 +55,8 @@
|
|||||||
<!-- </xpath> -->
|
<!-- </xpath> -->
|
||||||
<xpath expr="//form/sheet" position="before">
|
<xpath expr="//form/sheet" position="before">
|
||||||
<header>
|
<header>
|
||||||
<button string="生成货位" name="create_location" type="object" class="oe_highlight" attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
||||||
|
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
|
||||||
</header>
|
</header>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/sheet/group[last()]">
|
<xpath expr="//form/sheet/group[last()]">
|
||||||
@@ -64,6 +66,17 @@
|
|||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
<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>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -162,6 +175,324 @@
|
|||||||
<!-- sequence="50" -->
|
<!-- sequence="50" -->
|
||||||
<!-- action="kanban_action_id"/> -->
|
<!-- 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>
|
||||||
|
|
||||||
|
|
||||||
|
<!--路线根据权限增加审核按钮-->
|
||||||
|
<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>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user