隐藏功能刀具组装的创建按钮;刀具物料功能每齿走刀量模型新增加工方式字段,解决新增记录报错问题;解决计划管理-工作日历设置不自动生成工作日历的问题。
This commit is contained in:
@@ -382,7 +382,9 @@
|
|||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="cutting_speed"
|
<field name="cutting_speed"
|
||||||
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
||||||
<field name="materials_type_id"
|
<field name="machining_method" placeholder="请选择"
|
||||||
|
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||||
|
<field name="materials_type_id" placeholder="请选择"
|
||||||
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||||
<field name="blade_diameter"/>
|
<field name="blade_diameter"/>
|
||||||
<field name="feed_per_tooth"/>
|
<field name="feed_per_tooth"/>
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class FeedPerTooth(models.Model):
|
|||||||
product_template_id = fields.Many2one('product.template', string='产品')
|
product_template_id = fields.Many2one('product.template', string='产品')
|
||||||
|
|
||||||
cutting_speed = fields.Char('径向切宽 ae(mm)')
|
cutting_speed = fields.Char('径向切宽 ae(mm)')
|
||||||
|
machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式')
|
||||||
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
||||||
blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, compute='_compute_product_template_id')
|
blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, compute='_compute_product_template_id')
|
||||||
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)')
|
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)')
|
||||||
@@ -90,4 +91,4 @@ class FeedPerTooth(models.Model):
|
|||||||
@api.depends('product_template_id')
|
@api.depends('product_template_id')
|
||||||
def _compute_product_template_id(self):
|
def _compute_product_template_id(self):
|
||||||
if self.product_template_id is not None:
|
if self.product_template_id is not None:
|
||||||
self.blade_diameter = self.product_template_id.integral_blade_diameter
|
self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter
|
||||||
|
|||||||
@@ -140,6 +140,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="cutting_speed" attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
<field name="cutting_speed" attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
||||||
|
<field name="machining_method" attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||||
<field name="materials_type_id" attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
<field name="materials_type_id" attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||||
<field name="blade_diameter"/>
|
<field name="blade_diameter"/>
|
||||||
<field name="feed_per_tooth"/>
|
<field name="feed_per_tooth"/>
|
||||||
|
|||||||
@@ -135,8 +135,10 @@ class WorkLogSetting(models.Model):
|
|||||||
# 获取本年第一天和最后一天
|
# 获取本年第一天和最后一天
|
||||||
start_date = datetime.now().replace(month=1, day=1).date()
|
start_date = datetime.now().replace(month=1, day=1).date()
|
||||||
end_date = datetime.now().replace(month=12, day=31).date()
|
end_date = datetime.now().replace(month=12, day=31).date()
|
||||||
|
print(self.day_off_ids.mapped('name'))
|
||||||
# 休息日列表
|
# 休息日列表
|
||||||
rest_days = self.chinese_weekdays_to_english(self.day_off_ids.mapped('name'))
|
rest_days = self.chinese_weekdays_to_english(self.day_off_ids.mapped('name'))
|
||||||
|
print(rest_days)
|
||||||
for single_date in self.daterange(start_date, end_date):
|
for single_date in self.daterange(start_date, end_date):
|
||||||
is_workday = self.chinese_weekday_to_english(single_date.strftime("%A"))
|
is_workday = self.chinese_weekday_to_english(single_date.strftime("%A"))
|
||||||
logging.info(f"每天的星期:{is_workday}")
|
logging.info(f"每天的星期:{is_workday}")
|
||||||
@@ -155,13 +157,13 @@ class WorkLogSetting(models.Model):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
weekdays = {
|
weekdays = {
|
||||||
'星期一': 'Monday',
|
'星期一': 'Monday', 'Monday': 'Monday',
|
||||||
'星期二': 'Tuesday',
|
'星期二': 'Tuesday', 'Tuesday': 'Tuesday',
|
||||||
'星期三': 'Wednesday',
|
'星期三': 'Wednesday', 'Wednesday': 'Wednesday',
|
||||||
'星期四': 'Thursday',
|
'星期四': 'Thursday', 'Thursday': 'Thursday',
|
||||||
'星期五': 'Friday',
|
'星期五': 'Friday', 'Friday': 'Friday',
|
||||||
'星期六': 'Saturday',
|
'星期六': 'Saturday', 'Saturday': 'Saturday',
|
||||||
'星期日': 'Sunday'
|
'星期日': 'Sunday', 'Sunday': 'Sunday',
|
||||||
}
|
}
|
||||||
english_weekdays = []
|
english_weekdays = []
|
||||||
for chinese_weekday in chinese_weekdays:
|
for chinese_weekday in chinese_weekdays:
|
||||||
@@ -177,13 +179,13 @@ class WorkLogSetting(models.Model):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
weekdays = {
|
weekdays = {
|
||||||
'星期一': 'Monday',
|
'星期一': 'Monday', 'Monday': 'Monday',
|
||||||
'星期二': 'Tuesday',
|
'星期二': 'Tuesday', 'Tuesday': 'Tuesday',
|
||||||
'星期三': 'Wednesday',
|
'星期三': 'Wednesday', 'Wednesday': 'Wednesday',
|
||||||
'星期四': 'Thursday',
|
'星期四': 'Thursday', 'Thursday': 'Thursday',
|
||||||
'星期五': 'Friday',
|
'星期五': 'Friday', 'Friday': 'Friday',
|
||||||
'星期六': 'Saturday',
|
'星期六': 'Saturday', 'Saturday': 'Saturday',
|
||||||
'星期日': 'Sunday'
|
'星期日': 'Sunday', 'Sunday': 'Sunday',
|
||||||
}
|
}
|
||||||
weekday = weekdays.get(chinese_weekday)
|
weekday = weekdays.get(chinese_weekday)
|
||||||
if weekday:
|
if weekday:
|
||||||
|
|||||||
@@ -1080,7 +1080,7 @@
|
|||||||
<field name="name">功能刀具组装</field>
|
<field name="name">功能刀具组装</field>
|
||||||
<field name="model">sf.functional.tool.assembly</field>
|
<field name="model">sf.functional.tool.assembly</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree create="0">
|
||||||
<field name="functional_tool_code"/>
|
<field name="functional_tool_code"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
@@ -1133,7 +1133,7 @@
|
|||||||
<field name="name">功能刀具组装</field>
|
<field name="name">功能刀具组装</field>
|
||||||
<field name="model">sf.functional.tool.assembly</field>
|
<field name="model">sf.functional.tool.assembly</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form create="0">
|
||||||
<header>
|
<header>
|
||||||
<button string="组装"
|
<button string="组装"
|
||||||
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
||||||
|
|||||||
Reference in New Issue
Block a user