Community mailing list archives
Re: Order Date problem in POSby
Let's try to first clear up some confusion, create_date and date_order on pos.order mean different things. Although you say that create_date is always right, this is not true in the context of doing sale reports. The POS is meant to work offline, and the create_date you see in the database is simply the date on which the record was created by the server. An example use case
- load the POS frontend on a tablet and then disable WiFi
- create 10 orders spread over two hours
- connect to WiFi at time A
The create_date for those 10 orders will all be around time A (probably all within one second, depending on the speed of the server). As you can see it would be incorrect to use create_date if you want to generate a daily sales report. Instead we have the date_order field, which is not touched by the server at all but is set entirely by the client (the tablet in this case). The client sets this date_order when the user clicks the green "Validate" button, after inputting the payment. This is why it's important that the time and date on the tablet is properly configured (including time zone), because from the POS point of view that's all we have to go on.
Anyway, that being said, there does seem to be an inconsistency that occurs when the POS loads open orders from localStorage back into the frontend, this happens eg. when refreshing the POS frontend. It is possible that this is what is causing these 'faulty' dates in your case, we are currently looking into a solution. If you're interested in following along you can do so on GitHub . Do keep in mind that it's not necessarily this bug that is affecting you, for eg. row 1 in your screenshot, if you validated the order in the POS frontend at 15:20:23 and it was only able to send it to the server ~37 minutes later, then the behavior is correct.
On Fri, Sep 30, 2016 at 9:07 PM, Aires Silvestre <firstname.lastname@example.org> wrote:
Could see the revision e9b1254a. Even before all this started the build was far later May.
Adding more detailed info. It all started when last Saturday we performed a maintenance that included:
- Update of all Fedora packages. Again, F24, 64bit
Now we have scenarios like this:
Check the Order Date is 09/30/2016 11:53:38, later on in the next screenshot look at the create date in the metadata
Now the metadata of this Pos Order, the create_date is 09/30/2016 14:16:37
Another pattern we noticed is that in the postgres database, for the date_order column, some values have milliseconds and other don't. These entries without millisecond are those right, see rows 11, 12, and 13. In rows 11,12 and 13 we have date_order = create_date and in the other rows,
Furthermore, performed a psql -l and right now we are getting this:
We always use 'UTF8' for Encoding and 'en_US.utf8' for Collate and Ctype and now we noticed that pt_BR... wired.
On 09/30/2016 11:23 AM, Martin Trigaux wrote:
On 30/09/16 11:48, Aires Silvestre wrote: > We're facing an issue in some Point of Sales regarding the field Order > Date that is saved in model pos.order right after a sale in confirmed. > > Those POS run in Odoo V9 C, Fedora 24 64bit. It started from the moment > we updated Fedora packages and the Odoo build (build 29 September, > yesterday). > > Right after the sale is confirmed in the POS session, the instance of > pos.order is recorded with a wrong date in the field date_order. The > date recorded differs from the current time it is recorded, several > hours of difference and off course this affects sales reports. Because > they sale close to midnight is normal to get a specific sale made in one > day reported in another. Hello, There used to have a bug in this date (corrected in May, rev e9b1254a), if you are indeed using the latest build, the date_order should contain the date at the time of validation in the point of sale. One scenario that may explain a difference is if you have no internet connection. The orders are stored in the browser until it is able to reach the server. the create_date is when the order is received by the server but the date_order is the date of the validation. Martin -- Martin Trigaux Odoo https://odoo.com https://github.com/mart-e