OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.6 KiB

  1. # -*- coding: utf-8 -*-
  2. # © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp import api, fields, models
  5. class ReportCertificate(models.Model):
  6. _name = 'report.certificate'
  7. _order = 'sequence,id'
  8. @api.model
  9. def _default_company(self):
  10. m_company = self.env['res.company']
  11. return m_company._company_default_get('report.certificate')
  12. sequence = fields.Integer(default=10)
  13. name = fields.Char(required=True)
  14. path = fields.Char(
  15. string="Certificate file path", required=True,
  16. help="Path to PKCS#12 certificate file")
  17. password_file = fields.Char(
  18. string="Password file path", required=True,
  19. help="Path to certificate password file")
  20. model_id = fields.Many2one(
  21. string="Model", required=True,
  22. comodel_name='ir.model',
  23. help="Model where apply this certificate")
  24. domain = fields.Char(
  25. string="Domain",
  26. help="Domain for filtering if sign or not the document")
  27. allow_only_one = fields.Boolean(
  28. string="Allow only one document", default=True,
  29. help="If True, this certificate can not be useb to sign "
  30. "a PDF from several documents.")
  31. attachment = fields.Char(
  32. string="Save as attachment",
  33. help="Filename used to store signed document as attachment. "
  34. "Keep empty to not save signed document.")
  35. company_id = fields.Many2one(
  36. string='Company', comodel_name='res.company',
  37. required=True, default=_default_company)