添加功能
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user