[merge] improvements to pos

bzr revid: nicolas.vanhoren@openerp.com-20120109165105-mh96a3gllxk09466
This commit is contained in:
niv-openerp 2012-01-09 17:51:05 +01:00
commit 8bb04704e4
3 changed files with 18 additions and 52 deletions

View File

@ -76,7 +76,7 @@
background: -moz-linear-gradient(#b2b3d7, #7f82ac);
background: -webkit-gradient(linear, left top, left bottom, from(#b2b3d7), to(#7f82ac));
}
.point-of-sale #branding, .point-of-sale #steps, .point-of-sale #rightheader {
.point-of-sale #branding, .point-of-sale #rightheader {
float: left;
overflow: hidden;
height: 35px;
@ -84,48 +84,17 @@
}
.point-of-sale #rightheader {
float: none;
margin-left: 440px;
}
.point-of-sale #branding {
border-right: 1px solid #373737;
text-align: center;
text-align: left;
width: 419px;
}
.point-of-sale #branding img {
height: 32px;
width: 116px;
}
.point-of-sale #steps {
padding: 10px 17px;
border-right: solid 1px #3b3b3b;
vertical-align: top;
}
.point-of-sale #steps label {
width: 80px;
color: #A5A5A5;
font-weight: bold;
border-color: #454545;
background-color: #454545;
background-image: none;
border-bottom: solid 1px #5c5c5c;
border-top: solid 1px #373737;
vertical-align: top;
}
.point-of-sale #steps label:first-child {
border-left: solid 1px #373737;
}
.point-of-sale #steps label:last-child {
border-right: solid 1px #373737;
}
.point-of-sale #steps span {
padding: 2px 6px;
}
.point-of-sale #steps img {
height: 32px;
}
.point-of-sale #steps .ui-button, .point-of-sale #steps .ui-button-text-only {
padding-top: 4px;
height: 26px;
margin: 0 -4px;
}
}
.point-of-sale #neworder-button {
width: 32px;
padding: 4px 10px;
@ -492,6 +461,10 @@
white-space: nowrap;
}
.pos-payment-buttons {
white-space: nowrap;
}
@media print {
#oe_header, #oe_menu, .point-of-sale #topheader, .point-of-sale #leftpane {
display: none;

View File

@ -709,7 +709,7 @@ openerp.point_of_sale = function(db) {
It should be possible to go back to any step as long as step 3 hasn't been completed.
Modifying an order after validation shouldn't be allowed.
*/
var StepsWidget = db.web.Widget.extend({
var StepSwitcher = db.web.Widget.extend({
init: function(parent, options) {
this._super(parent);
this.shop = options.shop;
@ -985,6 +985,10 @@ openerp.point_of_sale = function(db) {
},
start: function() {
$('button#validate-order', this.$element).click(_.bind(this.validateCurrentOrder, this));
$('.oe-back-to-products', this.$element).click(_.bind(this.back, this));
},
back: function() {
this.shop.get('selectedOrder').set({"step": "products"});
},
validateCurrentOrder: function() {
var callback, currentOrder;
@ -1184,9 +1188,7 @@ openerp.point_of_sale = function(db) {
shop: this.shop,
});
this.receiptView.replace($('#receipt-screen'));
this.stepsView = new StepsWidget(null, {shop: this.shop});
this.stepsView.$element = $('#steps');
this.stepsView.start();
this.stepSwitcher = new StepSwitcher(this, {shop: this.shop});
this.shop.bind('change:selectedOrder', this.changedSelectedOrder, this);
this.changedSelectedOrder();
},
@ -1322,8 +1324,6 @@ openerp.point_of_sale = function(db) {
this.$element.find("#loggedas button").click(function() {
self.try_close();
});
this.$element.find('#steps').buttonset();
pos.app = new App(self.$element);
$('.oe_toggle_secondary_menu').hide();

View File

@ -8,16 +8,6 @@
<div id="branding">
<img src="/point_of_sale/static/src/img/logo.png" />
</div>
<div id="steps">
<input type="radio" id="products-step-button" class="step-button" data-step='products' name="radio" checked="checked" />
<label for="products-step-button">Products</label>
<img src="/point_of_sale/static/src/img/steps-arrow.png" />
<input type="radio" id="payment-step-button" class="step-button" data-step='payment' name="radio" />
<label for="payment-step-button">Payment</label>
<img src="/point_of_sale/static/src/img/steps-arrow.png" />
<input type="radio" id="receipt-step-button" class="step-button" data-step='receipt' name="radio" />
<label for="receipt-step-button">Receipt</label>
</div>
<div id="loggedas">
<span class="oe_pos_synch-notification"></span>
<button>Close</button>
@ -130,6 +120,9 @@
</table>
</div>
<div class="pos-payment-buttons">
<button class="oe-back-to-products">
<img src="/web/static/src/img/icons/gtk-go-back.png"></img>
Back to Products</button>
<button id="validate-order">
<img src="/web/static/src/img/icons/gtk-apply.png"></img>
Validate</button>