添加功能

This commit is contained in:
李鹏宇
2026-09-02 17:16:20 +08:00
parent 1e883fb91e
commit 2fdf2d06d4
5 changed files with 72 additions and 5 deletions
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
import logging
import datetime
from Tools.scripts.dutree import store
from odoo import models, fields, api, _, modules
from odoo.exceptions import ValidationError, UserError
@@ -117,15 +120,14 @@ class SoongWorkflowEntrust(models.Model):
@api.depends('start_date', 'end_date', 'is_expiration_date')
def compute_is_enable(self):
today = fields.Date.today()
for rec in self:
if rec.is_expiration_date:
rec.is_enable = True
elif rec.start_date and rec.end_date:
rec.is_enable = rec.start_date <= today < rec.end_date
else:
if rec.start_date and rec.end_date:
if rec.start_date <= fields.Date.today() < rec.end_date:
rec.is_enable = True
else:
rec.is_enable = False
rec.is_enable = False
class EntrustAll(models.Model):