[IMP] report_qweb_signer: Black python code

This commit is contained in:
Laurent-Corron
2021-06-29 10:10:17 +02:00
committed by Omar (Comunitea)
parent e9665dcfb3
commit b2b51f0e4c
13 changed files with 217 additions and 183 deletions

View File

@@ -5,38 +5,51 @@ from odoo import api, fields, models
class ReportCertificate(models.Model):
_name = 'report.certificate'
_description = 'Report Certificate'
_order = 'sequence,id'
_name = "report.certificate"
_description = "Report Certificate"
_order = "sequence,id"
@api.model
def _default_company(self):
m_company = self.env['res.company']
return m_company._company_default_get('report.certificate')
m_company = self.env["res.company"]
return m_company._company_default_get("report.certificate")
sequence = fields.Integer(default=10)
name = fields.Char(required=True)
path = fields.Char(
string="Certificate file path", required=True,
help="Path to PKCS#12 certificate file")
string="Certificate file path",
required=True,
help="Path to PKCS#12 certificate file",
)
password_file = fields.Char(
string="Password file path", required=True,
help="Path to certificate password file")
string="Password file path",
required=True,
help="Path to certificate password file",
)
model_id = fields.Many2one(
string="Model", required=True,
comodel_name='ir.model',
help="Model where apply this certificate")
string="Model",
required=True,
comodel_name="ir.model",
help="Model where apply this certificate",
)
domain = fields.Char(
string="Domain",
help="Domain for filtering if sign or not the document")
help="Domain for filtering if sign or not the document",
)
allow_only_one = fields.Boolean(
string="Allow only one document", default=True,
string="Allow only one document",
default=True,
help="If True, this certificate can not be useb to sign "
"a PDF from several documents.")
"a PDF from several documents.",
)
attachment = fields.Char(
string="Save as attachment",
help="Filename used to store signed document as attachment. "
"Keep empty to not save signed document.")
"Keep empty to not save signed document.",
)
company_id = fields.Many2one(
string='Company', comodel_name='res.company',
required=True, default=_default_company)
string="Company",
comodel_name="res.company",
required=True,
default=_default_company,
)