Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/订单计划

This commit is contained in:
qihao.gong@jikimo.com
2023-07-17 10:39:15 +08:00
8 changed files with 551 additions and 502 deletions

View File

@@ -184,6 +184,7 @@ class WorkLogSetting(models.Model):
'name_id': self.id,
'calendar_code': self.code,
'date_time': single_date})
@staticmethod
def daterange(start_date, end_date):
"""
@@ -193,6 +194,12 @@ class WorkLogSetting(models.Model):
for n in range(int((end_date - start_date).days)):
yield start_date + timedelta(n)
def open_work_schedule_calendar(self):
action = self.env.ref('sf_plan_management.sf_work_schedule_calendar_act')
result = action.read()[0]
result['domain'] = [('name_id', '=', self.id)]
return result
class WorkingShift(models.Model):
_name = 'sf.working.shift'

View File

@@ -40,10 +40,10 @@
sequence="15"
/>
<menuitem id="menu_sf_work_schedule_calendar"
name="工作日历"
parent="menu_sf_basic_setting"
action="sf_work_schedule_calendar_act"
sequence="15"
/>
<!-- <menuitem id="menu_sf_work_schedule_calendar"-->
<!-- name="工作日历"-->
<!-- parent="menu_sf_basic_setting"-->
<!-- action="sf_work_schedule_calendar_act"-->
<!-- sequence="15"-->
<!-- />-->
</odoo>

View File

@@ -16,7 +16,11 @@
<field name="status"/>
<field name="update_person"/>
<field name="update_time"/>
<!-- <button string="查看日历" type="object" name="sf_work_schedule_calendar_act"/>-->
<button string="查看日历"
type="object"
name="open_work_schedule_calendar"
class="oe_highlight"
/>
</tree>
</field>
</record>

View File

@@ -110,7 +110,7 @@ class MachineTableToolChangingApply(models.Model):
# string='换刀需求信息',
# attrs="{'invisible': 1}")
CNC_machine_table = fields.Char(string='CNC机床')
name = fields.Char(string='CNC机床')
# todo 机床类型和刀位号 为 Many2one
machine_table_type = fields.Char(string='机床类型')
machine_tool_code = fields.Char(string='机台号', attrs="{'invisible': 1}")
@@ -151,7 +151,7 @@ class MachineTableToolChangingApply(models.Model):
# todo 自动换刀申请条件需补充完善
if(self.functional_tool_status == '异常'):
self.env['sf.machine.table.tool.changing.apply'].search([
('CNC_machine_table', '=', self.CNC_machine_table)]).write({
('name', '=', self.name)]).write({
'replacement_tool_code': self.functional_tool_code,
'replacement_tool_name': self.functional_tool_name,
'replacement_tool_type': self.functional_tool_type,
@@ -167,7 +167,7 @@ class MachineTableToolChangingApply(models.Model):
# 新建组装任务
self.env['sf.functional.tool.assembly'].create({
'functional_tool_code': self.functional_tool_code,
'functional_tool_name': self.functional_tool_name,
'name': self.functional_tool_name,
'functional_tool_type': self.functional_tool_type,
'functional_tool_diameter': self.diameter,
'loading_task_source': '1',
@@ -189,7 +189,7 @@ class MachineTableToolChangingApply(models.Model):
"""
# 增加设置直径的值
tool_changing_apply = self.env['sf.machine.table.tool.changing.apply'].search(
[('CNC_machine_table', '=', vals['machine_tool_name'])])
[('name', '=', vals['name'])])
vals['functional_tool_diameter'] = tool_changing_apply.diameter
self.env['sf.functional.tool.assembly'].create(vals)
@@ -201,7 +201,7 @@ class MachineTableToolChangingApply(models.Model):
:return:
"""
# 撤回数据更新
self.env['sf.machine.table.tool.changing.apply'].search([('CNC_machine_table', '=', self.CNC_machine_table)]).write({
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name)]).write({
'replacement_tool_code': None,
'replacement_tool_name': None,
'replacement_tool_type': None,
@@ -225,7 +225,7 @@ class MachineTableToolChangingApply(models.Model):
:return:
"""
self.env['sf.machine.table.tool.changing.apply'].search(
[('CNC_machine_table', '=', self.CNC_machine_table)]).write({
[('name', '=', self.name)]).write({
'status': '0'
})
@@ -234,7 +234,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
_name = 'sf.cam.work.order.program.knife.plan'
_description = 'CAM工单程序用刀计划'
ticket_task_code = fields.Char(string='工单任务编号')
name = fields.Char(string='工单任务编号')
cam_procedure_code = fields.Char(string='CAM程序编号')
cam_cutter_spacing_code = fields.Char(string='CAM刀位号')
functional_tool_code = fields.Char(string='功能刀具编码')
@@ -263,7 +263,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
"""
self.env['sf.functional.tool.assembly'].create({
'functional_tool_code': self.functional_tool_code,
'functional_tool_name': self.functional_tool_name,
'name': self.functional_tool_name,
'functional_tool_type': self.functional_tool_type,
'functional_tool_diameter': self.diameter,
'functional_tool_length': self.tool_loading_length,
@@ -304,7 +304,7 @@ class FunctionalToolAssembly(models.Model):
_order = 'use_tool_time asc'
functional_tool_code = fields.Char(string='功能刀具编码')
functional_tool_name = fields.Char(string='功能刀具名称')
name = fields.Char(string='功能刀具名称')
functional_tool_type = fields.Char(string='功能刀具类型')
functional_tool_diameter = fields.Char(string='功能刀具直径')
functional_tool_length = fields.Char(string='功能刀具伸出长')
@@ -389,7 +389,7 @@ class FunctionalToolAssembly(models.Model):
for val in vals:
self.env['sf.delivery.of.cargo.from.storage'].create({
'functional_tool_code': val.functional_tool_code,
'functional_tool_name': val.functional_tool_name,
'name': val.name,
'functional_tool_type': val.functional_tool_type,
'production_line_name': val.production_line_name,
'machine_tool_code': val.machine_tool_code,
@@ -399,7 +399,7 @@ class FunctionalToolAssembly(models.Model):
else:
self.env['sf.delivery.of.cargo.from.storage'].create({
'functional_tool_code': self.functional_tool_code,
'functional_tool_name': self.functional_tool_name,
'name': self.name,
'functional_tool_type': self.functional_tool_type,
'production_line_name': self.production_line_name,
'machine_tool_code': self.machine_tool_code,

View File

@@ -169,7 +169,7 @@
<field name="model">sf.machine.table.tool.changing.apply</field>
<field name="arch" type="xml">
<tree>
<field name="CNC_machine_table"/>
<field name="name"/>
<field name="machine_tool_code" invisible="1"/>
<field name="machine_table_type"/>
<field name="cutter_spacing_code"/>
@@ -189,7 +189,7 @@
<button string="换刀申请"
name="%(sf_tool_management.sf_tool_change_requirement_information_act)d"
type="action"
context="{ 'default_CNC_machine_table':CNC_machine_table,
context="{ 'default_name':name,
'default_machine_tool_code': machine_tool_code,
'default_cutter_spacing_code': cutter_spacing_code,
'default_replacement_tool_code': functional_tool_code,
@@ -204,11 +204,11 @@
<button string="转移"
name="%(sf_tool_management.sf_tool_transfer_request_information_act)d"
type="action"
context="{ 'default_CNC_machine_table':CNC_machine_table,
context="{ 'default_name':name,
'default_machine_tool_code': machine_tool_code,
'default_cutter_spacing_code': cutter_spacing_code,
'default_functional_tool_code': functional_tool_code,
'default_functional_tool_name': functional_tool_name,
'default_name': functional_tool_name,
'default_functional_tool_type': functional_tool_type}"
class="btn-primary"
attrs="{'invisible': [('status', '!=', '0')]}"
@@ -235,7 +235,7 @@
<field name="model">sf.machine.table.tool.changing.apply</field>
<field name="arch" type="xml">
<search>
<field name="CNC_machine_table"/>
<field name="name"/>
<field name="machine_tool_code" invisible="1"/>
<field name="machine_table_type"/>
<field name="cutter_spacing_code"/>
@@ -279,7 +279,7 @@
<field name="model">sf.cam.work.order.program.knife.plan</field>
<field name="arch" type="xml">
<tree>
<field name="ticket_task_code"/>
<field name="name"/>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="functional_tool_code"/>
@@ -303,12 +303,12 @@
<button string="装刀申请"
name="%(sf_tool_management.sf_apply_for_tooling_act)d"
type="action"
context="{ 'default_ticket_task_code':ticket_task_code,
context="{ 'default_name':name,
'default_cam_procedure_code': cam_procedure_code,
'default_machine_table_name': machine_table_name,
'default_cam_cutter_spacing_code': cam_cutter_spacing_code,
'default_functional_tool_code': functional_tool_code,
'default_functional_tool_name': functional_tool_name,
'default_name': functional_tool_name,
'default_functional_tool_type': functional_tool_type,
'default_diameter': diameter,
'default_tool_loading_length': tool_loading_length,
@@ -335,7 +335,7 @@
<field name="model">sf.cam.work.order.program.knife.plan</field>
<field name="arch" type="xml">
<search>
<field name="ticket_task_code"/>
<field name="name"/>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="functional_tool_code"/>
@@ -375,7 +375,7 @@
<field name="arch" type="xml">
<tree>
<field name="functional_tool_code"/>
<field name="functional_tool_name"/>
<field name="name"/>
<field name="functional_tool_type"/>
<field name="functional_tool_diameter"/>
<field name="functional_tool_length"/>
@@ -404,7 +404,7 @@
context="{
'default_machine_tool_name': machine_tool_name,
'default_cutter_spacing_code': cutter_spacing_code,
'default_functional_tool_name': functional_tool_name,
'default_name': name,
'default_functional_tool_type': functional_tool_type,
'default_functional_tool_length': functional_tool_length,
'default_effective_length': None,
@@ -449,7 +449,7 @@
<field name="arch" type="xml">
<search>
<field name="functional_tool_code"/>
<field name="functional_tool_name"/>
<field name="name"/>
<field name="functional_tool_type"/>
<field name="functional_tool_diameter"/>
<field name="functional_tool_length"/>

View File

@@ -7,7 +7,7 @@ class ToolChangeRequirementInformation(models.TransientModel):
# tool_change_to_apply_id = fields.Many2one('sf.machine.table.tool.changing.apply', string='机床换刀申请')
CNC_machine_table = fields.Char(string='CNC机床', readonly=True)
name = fields.Char(string='CNC机床', readonly=True)
machine_tool_code = fields.Char(string='机台号', readonly=True)
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
@@ -29,7 +29,7 @@ class ToolChangeRequirementInformation(models.TransientModel):
"""
# 封装数据
desc = {
'CNC_machine_table': self.CNC_machine_table,
'name': self.name,
'machine_tool_code': self.machine_tool_code,
'cutter_spacing_code': self.cutter_spacing_code,
'replacement_tool_code': self.replacement_tool_code,
@@ -46,18 +46,18 @@ class ToolChangeRequirementInformation(models.TransientModel):
print('desc:', desc)
# 将数据更新到机台换刀申请界面
self.env['sf.machine.table.tool.changing.apply'].search(
[('CNC_machine_table', '=', desc.get('CNC_machine_table'))]).write(desc)
[('name', '=', desc.get('name'))]).write(desc)
# 功能刀具组装创建新任务
self.env['sf.machine.table.tool.changing.apply'].new_assembly_task({
'functional_tool_code': self.replacement_tool_code,
'functional_tool_name': self.replacement_tool_name,
'name': self.replacement_tool_name,
'functional_tool_type': self.replacement_tool_type,
'loading_task_source': '1',
'applicant': self.applicant,
'reason_for_applying': self.reason_for_applying,
'use_tool_time': self.used_tool_time,
'machine_tool_name': self.CNC_machine_table,
'machine_tool_name': self.name,
'machine_tool_code': self.machine_tool_code,
'cutter_spacing_code': self.cutter_spacing_code
})
@@ -133,7 +133,7 @@ class ApplyForTooling(models.TransientModel):
"""
self.env['sf.functional.tool.assembly'].create({
'functional_tool_code': self.functional_tool_code,
'functional_tool_name': self.functional_tool_name,
'name': self.functional_tool_name,
'functional_tool_type': self.functional_tool_type,
'functional_tool_diameter': self.diameter,
'functional_tool_length': self.tool_loading_length,
@@ -227,7 +227,7 @@ class DeliveryOfCargoFromStorage(models.TransientModel):
order = fields.Integer(string='')
functional_tool_code = fields.Char(string='功能刀具编码')
functional_tool_name = fields.Char(string='功能刀具名称')
name = fields.Char(string='功能刀具名称')
functional_tool_type = fields.Char(string='功能刀具类型')
production_line_name = fields.Char(string='产线名称')
machine_tool_code = fields.Char(string='机台号')
@@ -244,7 +244,7 @@ class DeliveryOfCargoFromStorage(models.TransientModel):
for val in vals:
self.env['sf.functional.tool.assembly'].search([
('functional_tool_code', '=', val.functional_tool_code),
('functional_tool_name', '=', val.functional_tool_name)
('name', '=', val.name)
]).write({
'assemble_status': '2',
'receive_person': self.env.user.name,
@@ -253,13 +253,13 @@ class DeliveryOfCargoFromStorage(models.TransientModel):
tool_assembly = self.env['sf.functional.tool.assembly'].search([
('functional_tool_code', '=', val.functional_tool_code),
('functional_tool_name', '=', val.functional_tool_name)
('name', '=', val.name)
])
# 判断装刀任务来源如果来源于CAM装刀则修改CAM装刀的计划执行状态
if tool_assembly.loading_task_source == '0':
self.env['sf.cam.work.order.program.knife.plan'].search([
('functional_tool_code', '=', val.functional_tool_code),
('functional_tool_name', '=', val.functional_tool_name)
('functional_tool_name', '=', val.name)
]).write({
'plan_execute_status': '2'
})

View File

@@ -10,7 +10,7 @@
<group>
<group>
<group>
<field name="CNC_machine_table"/>
<field name="name"/>
</group>
<group>
<field name="machine_tool_code"/>
@@ -275,7 +275,7 @@
<tree>
<field name="order"/>
<field name="functional_tool_code"/>
<field name="functional_tool_name"/>
<field name="name"/>
<field name="functional_tool_type"/>
<field name="production_line_name"/>
<field name="machine_tool_code"/>

View File

@@ -12,23 +12,27 @@ body.o_web_client {
.o_list_view {
.o_content .o_list_renderer.table-responsive {
overflow-x: initial;
.o_list_table {
thead, thead tr:nth-child(1) th {
position: sticky !important;
top: 0;
z-index: 1;
}
tfoot, tfoot tr:nth-child(1) td {
position: sticky !important;
bottom: 8px;
z-index: 1;
}
thead, tfoot {
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08) !important;
}
}
}
}
// LIST VIEW STICKY HEADER AND FOOTER END
}
@@ -41,9 +45,12 @@ body.o_web_client {
.o_list_view {
.o_content .o_list_renderer.table-responsive {
.o_list_table {
table-layout: unset !important;
thead, thead tr:nth-child(1) th, tfoot, tfoot tr:nth-child(1) td {
background-color: var(--biz-theme-secondary-color) !important;
}
thead, tfoot {
border-radius: var(--border-radius-lg) !important;
@@ -52,6 +59,7 @@ body.o_web_client {
border-top-left-radius: var(--border-radius-lg) !important;
border-bottom-left-radius: var(--border-radius-lg) !important;
}
&:last-child {
border-top-right-radius: var(--border-radius-lg) !important;
border-bottom-right-radius: var(--border-radius-lg) !important;
@@ -65,14 +73,17 @@ body.o_web_client {
.o_list_renderer {
.o_list_table {
background-color: unset !important;
thead, tfoot {
background-color: unset !important;
color: var(--biz-theme-body-text-color) !important;
}
.dropdown-toggle {
padding: 0 !important;
border: 0 !important;
}
tbody {
> tr > td:not(.o_list_record_selector).o_list_button > button {
padding: 0 5px !important;
@@ -80,6 +91,7 @@ body.o_web_client {
}
}
}
.o_content {
.o_list_renderer {
.o_list_table {
@@ -88,15 +100,18 @@ body.o_web_client {
thead {
color: var(--biz-theme-body-text-color) !important;
}
tbody {
tr {
&.o_group_header {
border-radius: var(--border-radius-md);
th {
&:first-child {
border-top-left-radius: var(--border-radius-md);
border-bottom-left-radius: var(--border-radius-md);
}
&:last-child {
border-top-right-radius: var(--border-radius-md);
border-bottom-right-radius: var(--border-radius-md);
@@ -105,6 +120,7 @@ body.o_web_client {
}
}
}
tfoot {
background-color: var(--biz-theme-secondary-color) !important;
color: var(--biz-theme-secondary-text-color) !important;
@@ -133,10 +149,12 @@ body.o_web_client {
thead {
background-color: transparent !important;
border: unset;
tr {
&:focus-within {
background-color: unset !important;
}
th {
border-top: 0 !important;
vertical-align: middle;
@@ -147,11 +165,13 @@ body.o_web_client {
font-size: var(--spiffy-font-size-md);
background-color: unset !important;
box-shadow: none !important;
&:focus-within {
background-color: unset !important;
}
}
}
.o_list_controller {
.dropdown-toggle {
border: 0;
@@ -191,6 +211,7 @@ body.o_web_client {
border-top-right-radius: var(--border-radius-lg) !important;
border-bottom-right-radius: var(--border-radius-lg) !important;
}
box-shadow: none !important;
}
@@ -203,6 +224,7 @@ body.o_web_client {
}
}
}
&:hover {
td, th {
box-shadow: none !important;
@@ -225,6 +247,7 @@ body.o_web_client {
height: var(--list-table-height);
border: 0;
}
vertical-align: middle;
font-weight: 500 !important;
border-top: 0 !important;
@@ -255,22 +278,26 @@ body.o_web_client {
.biz_attachment_section {
padding-top: 0 !important;
.attachment_box:not(.attachment_box_counter) {
.attachment-name {
width: 150px;
}
}
.attachment-name {
white-space: nowrap !important;
overflow: hidden;
text-overflow: ellipsis;
line-height: normal;
}
.attachment_box {
padding: 0.2rem;
min-height: 36px;
border-radius: var(--border-radius-lg) !important;
}
.o_image {
width: 30px !important;
height: 30px !important;
@@ -282,13 +309,16 @@ body.o_web_client {
tfoot {
background-color: unset !important;
border: 0 !important;
tr td {
border: 0 !important;
}
.o_list_number {
color: var(--biz-theme-primary-color) !important;
}
}
.o_optional_columns_dropdown_toggle {
top: 10px !important;
}
@@ -304,11 +334,13 @@ body.o_web_client {
.attachment_div {
height: 30px;
}
.biz_attachment_section {
.attachment_box {
padding-left: 0.5rem !important;
min-height: 30px;
}
.o_image {
width: 20px !important;
height: 20px !important;
@@ -354,15 +386,18 @@ body.o_web_client.dark_mode {
}
}
}
thead {
background-color: transparent !important;
border: unset;
}
tbody {
> tr.o_group_header {
background-image: linear-gradient(to bottom, #242424, #343434) !important;
}
}
&.table-responsive {
.o_list_table {
background-color: transparent !important;
@@ -382,6 +417,7 @@ body.o_web_client.dark_mode {
&.o_is_line_section {
background-color: #161616 !important;
}
td {
&:first-child {
border-top-left-radius: var(--border-radius-lg) !important;
@@ -498,6 +534,7 @@ body.o_web_client {
border: 1px solid #F4A460 !important;
}
}
.o_badge_cell {
// .o_field_badge {
// background-color: transparent !important;
@@ -509,6 +546,7 @@ body.o_web_client {
color: rgba(40, 167, 69, 0.9) !important;
border: 1px solid #28a745b0 !important;
}
.bg-info-light {
background-color: transparent !important;
color: rgba(23, 162, 184, 0.9) !important;