0

During install of the hr_timesheet_time_sheet module in Odoo 14 community edition, the stacktrace below is produced. This is related to recent changes in Odoo 14 handling of the Selection field # and #.

AssertionError: Field res.company.sheet_range with non-str value in selection

Gali_Mahesh
  • 51
  • 1
  • 5
  • Please provide a link to the module you installed. – Kenly Feb 09 '21 at 07:46
  • https://github.com/OCA/timesheet/tree/11.0/hr_timesheet_sheet From this folder i just add it into the version 14 addons. while installing this module i am getting this type of error as AssertionError: Field res.company.sheet_range with non-str value in selection – Gali_Mahesh Feb 09 '21 at 10:21
  • from odoo import fields, models from dateutil.rrule import (MONTHLY, WEEKLY, DAILY) _WEEKDAYS = [ ('0', 'Monday'), ('1', 'Tuesday'), ('2', 'Wednesday'), ('3', 'Thursday'), ('4', 'Friday'), ('5', 'Saturday'), ('6', 'Sunday') ] class ResCompany(models.Model): _inherit = 'res.company' sheet_range = fields.Selection([ (MONTHLY, 'Month'), (WEEKLY, 'Week'), (DAILY, 'Day')], string='Timesheet Sheet Range', default=WEEKLY, help="The range of your Timesheet Sheet.") – Gali_Mahesh Feb 09 '21 at 10:28
  • timesheet_week_start = fields.Selection( selection=_WEEKDAYS, string='Week start day', default='0') From this code i am getting such type of an error – Gali_Mahesh Feb 09 '21 at 10:29
  • You try to install an Odoo-11 module on Odoo-14, you may get errors as there are many changes in Odoo. You need to migrate the code from Odoo-11 to Odoo-14, you can try the [OCA guidelines](https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0) – Kenly Feb 09 '21 at 15:25

0 Answers0