Browse Source

Add message on POS open

Remove code that was not working
FIX bug in removeOrderLine
Update translation
pull/10/head
Alexis de Lattre 10 years ago
parent
commit
8499ce4972
  1. 38
      pos_customer_display/i18n/fr.po
  2. 32
      pos_customer_display/i18n/pos_customer_display.pot
  3. 56
      pos_customer_display/static/src/js/customer_display.js

38
pos_customer_display/i18n/fr.po

@ -6,9 +6,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-24 12:05+0000\n"
"PO-Revision-Date: 2014-10-24 12:05+0000\n"
"Last-Translator: Alexis de Lattre <alexis.delattre@akretion.com>\n"
"POT-Creation-Date: 2014-10-24 13:45+0000\n"
"PO-Revision-Date: 2014-10-24 13:45+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -17,22 +17,19 @@ msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:47
#: code:addons/pos_customer_display/static/src/js/customer_display.js:56
#, python-format
msgid "Cancel Payment"
msgstr "Paiement annulé"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:157
#: field:pos.config,iface_customer_display:0
#, python-format
msgid "Customer display"
msgstr "Afficheur client"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:31
#: code:addons/pos_customer_display/static/src/js/customer_display.js:41
#, python-format
msgid "Delete Item"
msgstr "Article supprimé"
@ -54,42 +51,35 @@ msgstr "Longueur des lignes"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:60
#: code:addons/pos_customer_display/static/src/js/customer_display.js:69
#, python-format
msgid "Next Customer"
msgstr "Client suivant"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:160
#, python-format
msgid "Offline"
msgstr "Hors ligne"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:40
#: code:addons/pos_customer_display/static/src/js/customer_display.js:81
#, python-format
msgid "Payment:"
msgstr "Paiement :"
msgid "Point of Sale Closed"
msgstr "Caisse fermée"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:66
#: code:addons/pos_customer_display/static/src/js/customer_display.js:75
#, python-format
msgid "Point of Sale Closed"
msgstr "Caisse fermée"
msgid "Point of Sale Open"
msgstr "Caisse ouverte"
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:39
#: code:addons/pos_customer_display/static/src/js/customer_display.js:48
#, python-format
msgid "TOTAL: "
msgstr "TOTAL : "
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:54
#: code:addons/pos_customer_display/static/src/js/customer_display.js:63
#, python-format
msgid "Your Change:"
msgstr "Monnaie à rendre :"

32
pos_customer_display/i18n/pos_customer_display.pot

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-24 12:04+0000\n"
"PO-Revision-Date: 2014-10-24 12:04+0000\n"
"POT-Creation-Date: 2014-10-24 13:44+0000\n"
"PO-Revision-Date: 2014-10-24 13:44+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -17,22 +17,19 @@ msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:47
#: code:addons/pos_customer_display/static/src/js/customer_display.js:56
#, python-format
msgid "Cancel Payment"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:157
#: field:pos.config,iface_customer_display:0
#, python-format
msgid "Customer display"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:31
#: code:addons/pos_customer_display/static/src/js/customer_display.js:41
#, python-format
msgid "Delete Item"
msgstr ""
@ -54,42 +51,35 @@ msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:60
#: code:addons/pos_customer_display/static/src/js/customer_display.js:69
#, python-format
msgid "Next Customer"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:160
#: code:addons/pos_customer_display/static/src/js/customer_display.js:81
#, python-format
msgid "Offline"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:40
#, python-format
msgid "Payment:"
msgid "Point of Sale Closed"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:66
#: code:addons/pos_customer_display/static/src/js/customer_display.js:75
#, python-format
msgid "Point of Sale Closed"
msgid "Point of Sale Open"
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:39
#: code:addons/pos_customer_display/static/src/js/customer_display.js:48
#, python-format
msgid "TOTAL: "
msgstr ""
#. module: pos_customer_display
#. openerp-web
#: code:addons/pos_customer_display/static/src/js/customer_display.js:54
#: code:addons/pos_customer_display/static/src/js/customer_display.js:63
#, python-format
msgid "Your Change:"
msgstr ""

56
pos_customer_display/static/src/js/customer_display.js

@ -1,3 +1,13 @@
/*
POS Customer display module for Odoo
Copyright (C) 2014 Aurélien DUMAINE
Copyright (C) 2014 Barroux Abbey (www.barroux.org)
@author: Aurélien DUMAINE
@author: Alexis de Lattre <alexis.delattre@akretion.com>
@author: Father Odilon (Barroux Abbey)
The licence is in the file __openerp__.py
*/
openerp.pos_customer_display = function(instance){
module = instance.point_of_sale;
@ -28,8 +38,8 @@ openerp.pos_customer_display = function(instance){
// first click on the backspace button set the amount to 0 => we can't precise the deleted qunatity and price
var line = data['line'];
var lines_to_send = new Array(
this.proxy.align_center(_t("Delete Item"), line_length),
this.proxy.align_center(line.get_product().name, line_length)
this.proxy.align_left(_t("Delete Item"), line_length),
this.proxy.align_right(line.get_product().display_name, line_length)
);
} else if (type == 'addPaymentline') {
@ -43,8 +53,8 @@ openerp.pos_customer_display = function(instance){
var line = data['line'];
var amount = line.get_amount().toFixed(currency_rounding);
var lines_to_send = new Array(
this.proxy.align_center(_t("Cancel Payment"), line_length),
this.proxy.align_left(line.cashregister.journal_id[1] , line_length - 1 - amount.length) + ' ' + amount
this.proxy.align_left(_t("Cancel Payment"), line_length),
this.proxy.align_right(line.cashregister.journal_id[1] , line_length - 1 - amount.length) + ' ' + amount
);
} else if (type == 'update_payment') {
@ -60,6 +70,12 @@ openerp.pos_customer_display = function(instance){
this.proxy.align_left(' ', line_length)
);
} else if (type == 'openPOS') {
var lines_to_send = new Array(
this.proxy.align_center(_t("Point of Sale Open"), line_length),
this.proxy.align_left(' ', line_length)
);
} else if (type = 'closePOS') {
var lines_to_send = new Array(
this.proxy.align_center(_t("Point of Sale Closed"), line_length),
@ -70,8 +86,8 @@ openerp.pos_customer_display = function(instance){
return;
}
// alert("In prepare_text_customer_display " + line_length);
this.proxy.send_text_customer_display(lines_to_send, line_length);
//console.log('prepare_text_customer_display type=' + type + ' | l1=' + lines_to_send[0] + ' | l2=' + lines_to_send[1]);
},
});
@ -140,29 +156,6 @@ openerp.pos_customer_display = function(instance){
},
});
//FIXME : nothing happen on customer display deconnection
var _super_setSmartStatus_ = module.ProxyStatusWidget.prototype.set_smart_status;
module.ProxyStatusWidget.prototype.set_smart_status = function(status){
_super_setSmartStatus_.call(this, status);
if (status.status === 'connected') {
var warning = false;
var msg = '';
if (this.pos.config.iface_customer_display) {
var customer_display = status.drivers.customer_display ? status.drivers.customer_display.status : false;
if (customer_display != 'connected' && customer_display != 'connecting') {
warning = true;
msg = msg ? msg + ' & ' : msg;
msg += _t('Customer display');
}
}
msg = msg ? msg + ' ' + _t('Offline') : msg;
this.set_status(warning ? 'warning' : 'connected', msg);
} else {
this.set_status(status.status, '');
}
};
var _super_addProduct_ = module.Order.prototype.addProduct;
module.Order.prototype.addProduct = function(product, options){
res = _super_addProduct_.call(this, product, options);
@ -226,4 +219,11 @@ openerp.pos_customer_display = function(instance){
return _super_closePOS_.call(this);
};
var _super_proxy_start_ = module.ProxyStatusWidget.prototype.start;
module.ProxyStatusWidget.prototype.start = function(){
res = _super_proxy_start_.call(this);
this.pos.prepare_text_customer_display('openPOS', {});
return res;
};
};
Loading…
Cancel
Save