Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0][pos_order_mgmt] Wrong format date and time in pos receipt when reprinting #839

Closed
javierjcf opened this issue Sep 16, 2022 · 3 comments
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Milestone

Comments

@javierjcf
Copy link

pos_order_mgmt

When I do a ticket I get the date and hour in my timezone. When I reprint that order is in american format and in UTC.

When ticket is printed firs time, odoo computes a field called formatted_validation_date with new Date(), whitch includes timezone.
When reprint, we get order_data.date_order un UTC, so when in the module you do:

 // Get Date
            if (["print"].indexOf(action) !== -1) {
                order.formatted_validation_date = moment(order_data.date_order).format(
                    "YYYY-MM-DD HH:mm:ss"
                );

The date does not respect original format, in my case dd/MM/YYYY, and is not converted from UTC to user timezone.

Somethgn like this solves tge issue I think:

    var local_date_hour = new Date(order_data.date_order + ' UTC').toISOString()
    order.formatted_validation_date = moment(local_date_hour).format(
        "DD/MM/YYYY HH:mm:ss"
    );

When the module calls the server, doing self.date_order I get UTC date, so in javascript is in UTC too. It should be converted to get the same date and same format than original receipt

@javierjcf javierjcf added the bug label Sep 16, 2022
@chienandalu chienandalu added this to the 13.0 milestone Sep 16, 2022
@chienandalu
Copy link
Member

Hi, @javierjcf Can you make the PR?

@javierjcf
Copy link
Author

Hi @chienandalu.

New PR: #850

@github-actions
Copy link

github-actions bot commented Apr 9, 2023

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

No branches or pull requests

2 participants