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.

18 lines
593 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 odoo import api, models
  5. from odoo.fields import Datetime
  6. class SubscriptionRequest(models.Model):
  7. _name = "subscription.request"
  8. _inherit = ["subscription.request", "external.id.mixin"]
  9. @api.multi
  10. def _timestamp_export(self):
  11. self.write({"last_api_export_date": Datetime.now()})
  12. self.filtered(lambda sr: not sr.first_api_export_date).write(
  13. {"first_api_export_date": Datetime.now()}
  14. )