odoo/odoo#207343
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 1s)
- label
- odoo-dev:saas-18.2-18.0-account-fix-statement-line-date-loug-431589-fw
- head
- d85eea548503cb531d438059be9d98a1949945b0
- merged
- 8 months ago by Training, Louis Gobert (loug)
| odoo/odoo | odoo/enterprise | |
|---|---|---|
| 18.0 | #204665 | #83870 |
| saas-18.1 | #207301 | #84057 |
| saas-18.2 | #207343 | #84074 |
| saas-18.3 | #207495 | #84145 |
| saas-18.4 | ||
| 19.0 | ||
| master | #207352 | #84078 |
[FW][FIX] account: fix statement line date
The date used in statement lines is invalid when lines
are created via bank synchronization, and the user has
configured a default date for the Invoice/Bill Date field.
Steps to reproduce:
- Set a default value for the Invoice/Bill Date field.
- Connect to Demo Bank and import the test statement line.
- Check the statement line date; it will use the default
Invoice/Bill Date value instead of the correct one.
The issue comes from the fact that during the
st_line.move_id.write(to_write), the date field gets considered 'dirty'
by the ORM (unless it is explicitly set in the vals), and when the
account.move.line tries to set-up its date, which is related to the
move, the compute method for the date is triggered as the field was
flagged as dirty.
Forward-Port-Of: #204665