Accept Merge Request #246: (feature/工作日历设置-工作日历表 -> develop)

Merge Request: 工作日历设置模型新增查看日历按键,隐藏工作日历菜单 

Created By: @禹翔辉
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/246?initial=true
This commit is contained in:
禹翔辉
2023-07-14 16:07:02 +08:00
3 changed files with 18 additions and 7 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>