mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 14:31:59 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -1,25 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import requests
|
||||
import werkzeug.urls
|
||||
|
||||
from ast import literal_eval
|
||||
|
||||
from odoo import api, release, SUPERUSER_ID
|
||||
import requests
|
||||
|
||||
from odoo import api, fields, release, SUPERUSER_ID
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.models import AbstractModel
|
||||
from odoo.tools.translate import _
|
||||
from odoo.tools import config, misc, ustr
|
||||
from odoo.tools import config
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PublisherWarrantyContract(AbstractModel):
|
||||
_name = "publisher_warranty.contract"
|
||||
class Publisher_WarrantyContract(AbstractModel):
|
||||
_name = 'publisher_warranty.contract'
|
||||
_description = 'Publisher Warranty Contract'
|
||||
|
||||
@api.model
|
||||
|
|
@ -29,16 +26,14 @@ class PublisherWarrantyContract(AbstractModel):
|
|||
|
||||
dbuuid = IrParamSudo.get_param('database.uuid')
|
||||
db_create_date = IrParamSudo.get_param('database.create_date')
|
||||
limit_date = datetime.datetime.now()
|
||||
limit_date = limit_date - datetime.timedelta(15)
|
||||
limit_date_str = limit_date.strftime(misc.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
limit_date = fields.Datetime.now() - datetime.timedelta(15)
|
||||
nbr_users = Users.search_count([('active', '=', True)])
|
||||
nbr_active_users = Users.search_count([("login_date", ">=", limit_date_str), ('active', '=', True)])
|
||||
nbr_active_users = Users.search_count([("login_date", ">=", limit_date), ('active', '=', True)])
|
||||
nbr_share_users = 0
|
||||
nbr_active_share_users = 0
|
||||
if "share" in Users._fields:
|
||||
nbr_share_users = Users.search_count([("share", "=", True), ('active', '=', True)])
|
||||
nbr_active_share_users = Users.search_count([("share", "=", True), ("login_date", ">=", limit_date_str), ('active', '=', True)])
|
||||
nbr_active_share_users = Users.search_count([("share", "=", True), ("login_date", ">=", limit_date), ('active', '=', True)])
|
||||
user = self.env.user
|
||||
domain = [('application', '=', True), ('state', 'in', ['installed', 'to upgrade', 'to remove'])]
|
||||
apps = self.env['ir.module.module'].sudo().search_read(domain, ['name'])
|
||||
|
|
@ -52,7 +47,7 @@ class PublisherWarrantyContract(AbstractModel):
|
|||
"nbr_active_users": nbr_active_users,
|
||||
"nbr_share_users": nbr_share_users,
|
||||
"nbr_active_share_users": nbr_active_share_users,
|
||||
"dbname": self._cr.dbname,
|
||||
"dbname": self.env.cr.dbname,
|
||||
"db_create_date": db_create_date,
|
||||
"version": release.version,
|
||||
"language": user.lang,
|
||||
|
|
@ -71,7 +66,7 @@ class PublisherWarrantyContract(AbstractModel):
|
|||
Utility method to send a publisher warranty get logs messages.
|
||||
"""
|
||||
msg = self._get_message()
|
||||
arguments = {'arg0': ustr(msg), "action": "update"}
|
||||
arguments = {'arg0': str(msg), "action": "update"}
|
||||
|
||||
url = config.get("publisher_warranty_url")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue