Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改缺陷
This commit is contained in:
@@ -3,6 +3,8 @@ from datetime import datetime, timedelta, date
|
||||
from odoo import models, fields, api
|
||||
import re
|
||||
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
def time_H_selection():
|
||||
return [('00', '00'), ('01', '01'), ('02', '02'), ('03', '03'), ('04', '04'), ('05', '05'),
|
||||
@@ -37,7 +39,7 @@ class WorkLogSetting(models.Model):
|
||||
return num
|
||||
|
||||
code = fields.Char(string='序号', default=_get_code, readonly=True)
|
||||
name = fields.Char(string='工作日历名称', required=True)
|
||||
name = fields.Char(string='工作日历名称', required=True, size=15, length=30)
|
||||
|
||||
start_time = fields.Char(string='日开始时间', readonly=True, compute='_compute_start_time')
|
||||
start_time_H = fields.Selection(time_H_selection(), '时', required=True)
|
||||
@@ -182,7 +184,6 @@ class WorkLogSetting(models.Model):
|
||||
self.env['sf.work.schedule.calendar'].sudo().create({
|
||||
'name': '休息日',
|
||||
'name_id': self.id,
|
||||
'calendar_code': self.code,
|
||||
'date_time': single_date})
|
||||
|
||||
@staticmethod
|
||||
@@ -249,7 +250,7 @@ class WorkScheduleCalendar(models.Model):
|
||||
name = fields.Selection([('休息日', '休息日'), ('计划停机', '计划停机'), ('工作日', '工作日')], '日历事件名称')
|
||||
date_time = fields.Date('休息时间')
|
||||
name_id = fields.Many2one('sf.work.log.setting', '工作日历名称')
|
||||
calendar_code = fields.Char('工作日历编码')
|
||||
calendar_code = fields.Char('工作日历编码', readonly=True, compute='_compute_name_id')
|
||||
|
||||
day_off_id = fields.Many2many('sf.day.off', string='休息日')
|
||||
scheduled_outage = fields.Char('计划停机')
|
||||
@@ -257,3 +258,9 @@ class WorkScheduleCalendar(models.Model):
|
||||
annual_rest_days = fields.Char('年休息天数', readonly=True)
|
||||
monthly_planned_downtime = fields.Char('月计划停机时长', readonly=True)
|
||||
annual_planned_downtime = fields.Char('年计划停机时长', readonly=True)
|
||||
|
||||
@api.depends('name_id')
|
||||
def _compute_name_id(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.calendar_code = record.name_id.code
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</group>
|
||||
<group string="日历状态">
|
||||
<field name="status"/>
|
||||
<field name="setting_to_calendar_ids"/>
|
||||
<field name="setting_to_calendar_ids" invisible="True"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -175,12 +175,6 @@
|
||||
<field name="calendar_code"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="其他">
|
||||
<field name="monthly_rest_days"/>
|
||||
<field name="annual_rest_days"/>
|
||||
<field name="monthly_planned_downtime"/>
|
||||
<field name="annual_planned_downtime"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -49,6 +49,8 @@ body.o_web_client {
|
||||
|
||||
thead, thead tr:nth-child(1) th, tfoot, tfoot tr:nth-child(1) td {
|
||||
background-color: var(--biz-theme-secondary-color) !important;
|
||||
width: unset !important;
|
||||
max-width: unset !important;
|
||||
}
|
||||
|
||||
thead, tfoot {
|
||||
|
||||
Reference in New Issue
Block a user