Skip to content

[10.0] Medical: day is out of range for month #202

@woodbrettm

Description

@woodbrettm
  • Applies to Medical
  • Test only failing under certain circumstances causing logs below:
  • Error happening here
  • Failing test here
ERROR
ERROR: test_search_age (odoo.addons.medical.tests.test_medical_patient.TestMedicalPatient)
` When patients are searched by age, it should return patients with the corresponding birth dates
Traceback (most recent call last):
`   File "/home/travis/build/LasLabs/vertical-medical/medical/tests/test_medical_patient.py", line 158, in test_search_age
`     [('age', '=', years)]
`   File "/home/travis/odoo-10.0/odoo/models.py", line 1518, in search
`     res = self._search(args, offset=offset, limit=limit, order=order, count=count)
`   File "/home/travis/odoo-10.0/odoo/models.py", line 4224, in _search
`     query = self._where_calc(args)
`   File "/home/travis/odoo-10.0/odoo/models.py", line 4023, in _where_calc
`     e = expression.expression(domain, self)
`   File "/home/travis/odoo-10.0/odoo/osv/expression.py", line 643, in __init__
`     self.parse()
`   File "/home/travis/odoo-10.0/odoo/osv/expression.py", line 896, in parse
`     domain = field.determine_domain(model, operator, right)
`   File "/home/travis/odoo-10.0/odoo/fields.py", line 1007, in determine_domain
`     return getattr(records, self.search)(operator, value)
`   File "/home/travis/build/LasLabs/vertical-medical/medical/models/medical_patient.py", line 124, in _search_age
`     day=current_day - 1
` ValueError: day is out of range for month

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions