(v13) `Datetime` in `Model.write` seems to be able to take a `datetime`, but docs say only `str` is accepted
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 1.3k
- Forks
- 12.1k
- PR merge metrics
- No merged PRs in 30d
Description
https://www.odoo.com/documentation/13.0/developer/reference/addons/orm.html#odoo.models.Model.write
Under "Other non-relational fields use a string for value" you can see a "Danger" box with the following text:
"for historical and compatibility reasons, Date and Datetime fields use strings as values (written and read) rather than date or datetime."
In my testing this seems to be wrong. I can pass a datetime as the value for a Datetime field and it seems to work just fine. Can someone else verify this?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Odoo ORM documentation section, “Other non-relational fields use a string for value,” and reproduce the reported Model.write behavior using a Datetime field and a datetime value. Compare the result with the documented warning; the work is done when the behavior is verified and the documentation accurately reflects it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100