添加功能

This commit is contained in:
李鹏宇
2026-01-30 14:32:06 +08:00
parent f464eb1388
commit ef7a17811f
9 changed files with 81 additions and 6 deletions
+1
View File
@@ -12,6 +12,7 @@
'views/ir_cron_act_views.xml',
'views/yuthon_timed_tasks_views.xml',
'views/yuthon_timed_tasks_views.xml',
'views/base_month_year_views.xml',
'views/yuthon_phone_lotter.xml',
'views/menu.xml',
],
+2 -1
View File
@@ -5,4 +5,5 @@ from . import fields_piyin
from . import ir_cron_act
from . import yuthon_timed_tasks
from . import yuthon_phone_lottery
from . import res_partner
from . import res_partner
from . import base_month_year
+22
View File
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta, time
from email.policy import default
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
import re
from odoo.tools.misc import format_date
class BaseYearMonth(models.Model):
_name = 'base.year'
_description = '系统年份'
name = fields.Integer(string='年', required=True)
class BaseMonth(models.Model):
_name = 'base.month'
_description = '系统月份'
name = fields.Integer(string='月', required=True)
+3 -1
View File
@@ -3,4 +3,6 @@ access_system_version,system_version,model_system_version,base.group_system,1,1,
access_ir_cron_type,ir.cron.type,model_ir_cron_type,base.group_system,1,1,1,1
access_yuthon_timed_tasks,yuthon.timed.tasks,model_yuthon_timed_tasks,base.group_system,1,1,1,1
access_users_home_batch_wizard,access_users_home_batch_wizard,model_users_home_batch_wizard,base.group_user,1,1,1,1
access_phone_lottery,phone.lottery,model_phone_lottery,base.group_user,1,1,1,1
access_phone_lottery,phone.lottery,model_phone_lottery,base.group_user,1,1,1,1
access_base_year,base.year,model_base_year,base.group_system,1,1,1,1
access_base_month,base.month,model_base_month,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_ir_cron_type ir.cron.type model_ir_cron_type base.group_system 1 1 1 1
4 access_yuthon_timed_tasks yuthon.timed.tasks model_yuthon_timed_tasks base.group_system 1 1 1 1
5 access_users_home_batch_wizard access_users_home_batch_wizard model_users_home_batch_wizard base.group_user 1 1 1 1
6 access_phone_lottery phone.lottery model_phone_lottery base.group_user 1 1 1 1
7 access_base_year base.year model_base_year base.group_system 1 1 1 1
8 access_base_month base.month model_base_month base.group_system 1 1 1 1
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_base_year_tree" model="ir.ui.view">
<field name="name">base.year.tree</field>
<field name="model">base.year</field>
<field name="arch" type="xml">
<tree string="年份" editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_base_month_tree" model="ir.ui.view">
<field name="name">base.month.tree</field>
<field name="model">base.month</field>
<field name="arch" type="xml">
<tree string="月份" editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_base_year_action" model="ir.actions.act_window">
<field name="name">年份配置</field>
<field name="res_model">base.year</field>
<field name="view_mode">tree</field>
</record>
<record id="view_base_month_action" model="ir.actions.act_window">
<field name="name">月份配置</field>
<field name="res_model">base.month</field>
<field name="view_mode">tree</field>
</record>
</odoo>
+10
View File
@@ -33,4 +33,14 @@
parent="cron_type_menu_root"
action="view_yuthon_lottery_action"
sequence="10"/>
<menuitem id="yuthon_base_year"
name="年份配置"
parent="cron_type_menu_root"
action="view_base_year_action"
sequence="15"/>
<menuitem id="yuthon_base_months"
name="月份配置"
parent="cron_type_menu_root"
action="view_base_month_action"
sequence="20"/>
</odoo>