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
512 B

  1. # Copyright 2009-2017 Noviat.
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, fields, models
  4. class AccountCommonReport(models.TransientModel):
  5. _inherit = 'account.common.report'
  6. date_range_id = fields.Many2one(
  7. comodel_name='date.range',
  8. string='Date range',
  9. )
  10. @api.onchange('date_range_id')
  11. def _onchange_date_range_id(self):
  12. self.date_from = self.date_range_id.date_start
  13. self.date_to = self.date_range_id.date_end