初始提交

This commit is contained in:
2026-11-04 19:58:07 +08:00
commit 53b7d22429
829 changed files with 469986 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api
from odoo.models import AbstractModel
from odoo.tools import cloc
class Publisher_WarrantyContract(AbstractModel):
_inherit = "publisher_warranty.contract"
@api.model
def _get_message(self):
msg = super()._get_message()
ICP = self.env["ir.config_parameter"]
if ICP.get_bool('publisher_warranty.maintenance_disable'):
return msg
msg['maintenance'] = {
"version": cloc.VERSION,
}
try:
c = cloc.Cloc()
c.count_env(self.env)
if c.code:
msg["maintenance"]["modules"] = c.code
if c.errors:
msg["maintenance"]["errors"] = list(c.errors.keys())
except Exception:
msg["maintenance"]["errors"] = ['cloc/error']
ICP.set_str('publisher_warranty.cloc', str(msg['maintenance']))
return msg