Merge pull request !7031 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-12-13 07:05:12 +00:00
committed by Gitee
5 changed files with 9 additions and 15 deletions
+4 -10
View File
@@ -175,21 +175,15 @@ class SoongWorkflowRecord(models.Model):
workflow.employee_ids = [(6, 0, [])]
def execute_button_code(self, button_id, res_model, res_id):
"""
执行按钮code字段中的代码,动态解析并验证方法是否存在
:param button_id: soong.workflow.node.button的记录ID
:param res_model: 模型名称
"""
button = self.env["soong.workflow.node.button"].browse(button_id)
if not button or not button.code:
return
workflow = button.node_id.workflow_id if button.node_id else None
obj = self.env[res_model].browse(res_id)
pattern = r'obj\.(\w+)\s*\('
methods = re.findall(pattern, button.code, re.MULTILINE)[0]
if methods:
obj.__getattribute__(methods)()
if re.findall(pattern, button.code, re.MULTILINE):
methods = re.findall(pattern, button.code, re.MULTILINE)[0]
if methods:
obj.__getattribute__(methods)()
def _log_debug(self, message):
@@ -113,7 +113,7 @@
<field name="current_read" string="本次读数"/>
<field name="last_read" string="上次读数"/>
<field name="lessee_id" string="承租方"/>
<field name="yuthon_property_ids" string="地址"/>
<field name="yuthon_property_ids" string="地址" widget="many2many_tags"/>
<field name="epitope_values_id" string="表位置"/>
<field name="last_meter" string="上次抄表日期"/>
<field name="last_dosage" string="上次用量"/>
@@ -115,7 +115,7 @@
<field name="current_read" string="本次读数"/>
<field name="last_read" string="上次读数"/>
<field name="lessee_id" string="承租方"/>
<field name="yuthon_property_ids" string="地址"/>
<field name="yuthon_property_ids" string="地址" widget="many2many_tags"/>
<field name="epitope_values_id" string="表位置"/>
<field name="last_meter" string="上次抄表日期"/>
<field name="last_dosage" string="上次用量"/>
+2 -2
View File
@@ -27,9 +27,9 @@ class SealsTypeSetting(models.Model):
_description = '用章类型'
name = fields.Char(string='名称')
scope_setting_ids = fields.Many2many('seals.scope.setting', string="用章范围")
scope_setting_id = fields.Many2one('seals.scope.setting', string="用章范围")
department_id = fields.Many2one('hr.department', string="部门")
user_id = fields.Many2many('res.users', string="保管人")
user_id = fields.Many2one('res.users', string="保管人")
start_date = fields.Date(string="生效日期", copy=False, default=fields.Date.today())
end_date = fields.Date(string="失效日期")
is_effect = fields.Boolean(string="是否生效", compute="_compute_is_effect")
@@ -34,7 +34,7 @@
<field name="arch" type="xml">
<tree string="用章类型" editable="bottom">
<field name="name"/>
<field name="scope_setting_ids" widget="many2many_tags"/>
<field name="scope_setting_id"/>
<field name="user_id"/>
<field name="department_id"/>
<field name="start_date"/>