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.

22 lines
805 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import fields, models
  5. class IrSequence(models.Model):
  6. _inherit = 'ir.sequence'
  7. date_range_field = fields.Selection(
  8. selection=[
  9. ('date_from', 'From'),
  10. ('date_to', 'To'),
  11. ],
  12. required=True,
  13. default="date_from",
  14. help="Define which date field must be used in case of date ranges as "
  15. "the reference date to generate sequences.\n"
  16. "Ex: date_from = '2018-10-01' and date_to = '2019-09-30'.\n"
  17. "If you pick 'date_to' as reference date, your range_year will "
  18. "be 2019 (2018 if you pick the 'date_from', who is the default)",
  19. )