Skip to content

Conversation

ryv-odoo
Copy link
Contributor

@ryv-odoo ryv-odoo commented Aug 28, 2024

The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the base_style instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701

@robodoo
Copy link
Contributor

robodoo commented Aug 28, 2024

Pull request status dashboard

@C3POdoo C3POdoo requested review from a team, BastienFafchamps, HydrionBurst, Julien00859, kebeclibre and kmagusiak and removed request for a team August 28, 2024 12:40
@C3POdoo C3POdoo added the RD research & development, internal work label Aug 28, 2024
@ryv-odoo ryv-odoo force-pushed the master-fix-monetary-export-ryv branch 3 times, most recently from adb5f76 to df53d5e Compare August 29, 2024 12:04
@ryv-odoo ryv-odoo force-pushed the master-fix-monetary-export-ryv branch 5 times, most recently from 2f8e2bb to 53c39a7 Compare August 29, 2024 14:59
@ryv-odoo ryv-odoo changed the title [FIX] core: fix export format for monetary and int [FIX] web: make export consistent for int/float/monetary field Aug 29, 2024
@ryv-odoo ryv-odoo force-pushed the master-fix-monetary-export-ryv branch 3 times, most recently from 7b14f85 to 8275ebb Compare September 4, 2024 08:36
@ryv-odoo ryv-odoo force-pushed the master-fix-monetary-export-ryv branch from 8275ebb to 0e1cbbe Compare September 4, 2024 10:59
The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the `base_style` instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701
In the previous fix, we need the field type during the export (or
it raises a KeyError by `field['type'] == ...`). The field information
comes from the web/export/get_fields route and can also come
from the web/export/namelist route when you use a export template.
But for web/export/namelist, we only send back field id and string
(label) information. Then we try to export we got a Traceback because
there is no field type.

One solution is to make the previous fix robust by using
`field.get('type')`, but it hides the issue and make the previous fix
and previous other usage of field type useless. Then fix
web/export/namelist to return the field type information.
@ryv-odoo ryv-odoo force-pushed the master-fix-monetary-export-ryv branch from 0e1cbbe to 22608af Compare September 13, 2024 12:15
@ryv-odoo
Copy link
Contributor Author

@robodoo r+
(last push was only a rebase)

@robodoo
Copy link
Contributor

robodoo commented Sep 13, 2024

@ryv-odoo because this PR has multiple commits, I need to know how to merge it:

  • merge to merge directly, using the PR as merge commit message
  • rebase-merge to rebase and merge, using the PR as merge commit message
  • rebase-ff to rebase and fast-forward

@ryv-odoo
Copy link
Contributor Author

@robodoo rebase-merge

@robodoo
Copy link
Contributor

robodoo commented Sep 13, 2024

Merge method set to rebase and merge, using the PR as merge commit message.

robodoo pushed a commit that referenced this pull request Sep 14, 2024
The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the `base_style` instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701

Part-of: #178214
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
robodoo pushed a commit that referenced this pull request Sep 14, 2024
In the previous fix, we need the field type during the export (or
it raises a KeyError by `field['type'] == ...`). The field information
comes from the web/export/get_fields route and can also come
from the web/export/namelist route when you use a export template.
But for web/export/namelist, we only send back field id and string
(label) information. Then we try to export we got a Traceback because
there is no field type.

One solution is to make the previous fix robust by using
`field.get('type')`, but it hides the issue and make the previous fix
and previous other usage of field type useless. Then fix
web/export/namelist to return the field type information.

Part-of: #178214
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
robodoo added a commit that referenced this pull request Sep 14, 2024
The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the `base_style` instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701

closes #178214

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
robodoo pushed a commit that referenced this pull request Sep 14, 2024
The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the `base_style` instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701

Part-of: #178214
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
robodoo pushed a commit that referenced this pull request Sep 14, 2024
In the previous fix, we need the field type during the export (or
it raises a KeyError by `field['type'] == ...`). The field information
comes from the web/export/get_fields route and can also come
from the web/export/namelist route when you use a export template.
But for web/export/namelist, we only send back field id and string
(label) information. Then we try to export we got a Traceback because
there is no field type.

One solution is to make the previous fix robust by using
`field.get('type')`, but it hides the issue and make the previous fix
and previous other usage of field type useless. Then fix
web/export/namelist to return the field type information.

Part-of: #178214
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
robodoo added a commit that referenced this pull request Sep 14, 2024
The float/monetary/int can be in an incorrect format depending of the
other columns format. Then int was sometimes show as float (1.00 by
example). Same situation for monetary, that was often export as an
integer.

It was because we changed the `base_style` instead of having one by type
of field.

Fix these kinds of inconsistency.

task-4129701

closes #178214

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
@robodoo robodoo closed this Sep 14, 2024
@robodoo robodoo added the 17.5 label Sep 14, 2024
@fw-bot fw-bot deleted the master-fix-monetary-export-ryv branch September 28, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

17.5 RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants