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.

19 lines
517B

  1. # Copyright 2021 Tecnativa - Víctor Martínez
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import api, fields, models
  4. class OdooManifestKey(models.Model):
  5. _name = "odoo.manifest.key"
  6. _description = "Odoo Manifest Key"
  7. name = fields.Char()
  8. @api.model
  9. def create_if_not_exist(self, name):
  10. manifest_key = self.search([("name", "=", name)])
  11. if not manifest_key:
  12. manifest_key = self.create({"name": name})
  13. return manifest_key
上海开阖软件有限公司 沪ICP备12045867号-1