Public release from ruodoo-project: 19.0 - 2026-09-20 21:17:41 UTC

This commit is contained in:
CI Publish Bot
2026-09-20 21:17:50 +00:00
commit ebd298dbf0
1234 changed files with 187334 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from odoo import models, fields, api
import os
class ReportTemplate(models.Model):
_name = 'contract.report.template'
_description = 'Шаблоны отчетов'
name = fields.Char(string='Название', required=True)
attachment = fields.Binary(string='Файл шаблона', required=True)
attachment_filename = fields.Char(string='Имя файла')
typeformat = fields.Char(string='Формат', compute='_compute_format', store=True)
create_date = fields.Datetime(string='Дата создания', default=fields.Datetime.now)
@api.depends('attachment_filename')
def _compute_typeformat(self):
for rec in self:
if rec.attachment_filename:
rec.typeformat = os.path.splitext(rec.attachment_filename)[1].lstrip('.').lower()
else:
rec.typeformat = False