Skip to Content
Menu
This question has been flagged
3 Replies
5001 Views

Due to technical reason a bunch of orders are kept OFF LINE and the connection to the POS raises an error message saying that a document has been deleted, preventing the connection between the POS interface and the current database.

Question is : how to recover the orders? where are they saved on the local machine (which directory, data format)?

At least if I knew the original data for these orders I could enter each again - manually - into the database

Thanks for any clue.

Avatar
Discard
Best Answer

Hello Thomas, did you solve it?

I have the same issue.

Thank you.

Avatar
Discard
Best Answer

Hi, Thomas

it is the common problem while running multi-company uses same pos or any connection lose happen

while you running pos the session automatically change to closed or any other sate

and your current order will lose.....................

i will send you a module in pos to solve the session problem.........it will check every second your session closed or not and it will display a popup while session close ,

my clients are still using this module in all odoo versions if you have any problem please contact me :9633097060(india) or email me i will send the module to you ,id :manakkunnathjith@gmail.com

py part.....................

class PosConfig(models.Model):
    _inherit = 'pos.config'

    check_session_state_frequency = fields.Integer(
        string="Frequency of Checking the State of the Session",
        default=1, help="The value is set in seconds.")

    @api.model
    def get_status(self, ref):
        lines = self.env['pos.session'].search([('id', '=', ref)])
        result = lines.state
        return result

    @api.model
    def update_status(self, ref):
        code_check = self.env['pos.session'].search([('id', '=', ref)])
        # if code_check == False:
        print 'No postcode in database, writing ....'
        print code_check.state
        code_check.write({'state': 'opened'})
        print code_check.state
        return ref


js part

odoo.define('pos_check_session_state',function(require){
"use strict";

var PopupWidgets = require('point_of_sale.popups');
var gui = require('point_of_sale.gui');
var chrome = require('point_of_sale.chrome');
var PosBaseWidget = require('point_of_sale.BaseWidget');
var popups = require('point_of_sale.popups');
var QWeb = core.qweb;
var _t = core._t;
var PopupWidget = require('point_of_sale.popups');
var _t = core._t;


var ErrorClosedSessionPopupWidget = PopupWidget.extend({
    template:'ErrorClosedSessionPopupWidget',

        init: function(parent, options) {
            var self = this;
            this._super(parent, options);


            self.intervalID = setInterval(function() {
                var order_new = self.pos.pos_session;
                 new Model('pos.config').call('get_status',[order_new.id]).then(function(result){
                    if (result=='opened'){
//                        console.log("opened the session");
                    }
                    else{
                        console.log("session blocked");2
                        self.gui.show_popup('lock1');
                    }
                });

            }, self.pos.config.check_session_state_frequency * 1000);
        },
        show: function(opts) {
            var self = this;
            this._super(opts);
            var order_new = self.pos.pos_session;
            this.$('.cancel').off('click').click(function(){
               new Model('pos.config').call('update_status',[order_new.id]).then(function(result){
                    console.log(result);
                    location.reload();

                });
            });
             this.$('.cancell').off('click').click(function(){
               window.history.back();
               new Model('pos.config').call('update_status',[order_new.id]).then(function(result){
                    console.log(result);


                });
            });
        }
});
gui.define_popup({name:'lock1', widget: ErrorClosedSessionPopupWidget});





chrome.Chrome.include({
//var module = init.PosBaseWidget.extend({
    build_widgets: function(){
        this._super();
            // Add a new Popup 'ErrorClosedSessionPopupWidget'
            this.error_closed_session_popup = new ErrorClosedSessionPopupWidget(this, {});
            this.error_closed_session_popup.appendTo(this.$el);

//            this.screen_selector.popup_set['error-closed-session'] = this.error_closed_session_popup;

            // Hide the popup because all pop up are displayed at the
            // beginning by default
            this.error_closed_session_popup.hide();
    },
});

});


Avatar
Discard
Author

Thanks Jithesh for your post. However it doe not solve my short term issue which is to somehow to recover some POS Orders stucked into one client machine.

Don't you know where they are saved onto this machine (directory, file name and format) so that I can post these Orders manually, one by one?

Regards

Related Posts Replies Views Activity
0
Dec 24
44
1
Dec 24
167
0
Nov 24
83
1
Nov 24
152
1
Nov 24
187