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.

24 lines
662 B

  1. # Copyright 2020 Coop IT Easy SCRL fs
  2. # Robin Keunen <robin@coopiteasy.be>
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  4. from os.path import join
  5. from odoo import api, fields, models
  6. class SubscriptionRequest(models.Model):
  7. _inherit = "subscription.request"
  8. external_id = fields.Integer(
  9. string="External ID", index=True, required=False
  10. )
  11. @api.multi
  12. def get_external_id(self):
  13. self.ensure_one()
  14. if not self.external_id:
  15. self.external_id = self.env["ir.sequence"].next_by_code(
  16. "subscription.request.external.id"
  17. )
  18. return self.external_id