Merge lp:~openerp-dev/openobject-addons/7.0-opw-596189-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 9349
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-596189-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 51 lines (+16/-1)
2 files modified
point_of_sale/static/src/js/screens.js (+9/-1)
point_of_sale/static/src/js/widgets.js (+7/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-596189-msh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Martin Trigaux (OpenERP) Pending
Review via email: mp+179034@code.launchpad.net

Description of the change

Hello,

Fixed the issue of current focused line in pos front end, also fixed numpadState buffer, changing focus adds character of last changed payment line to current line.

Demo:- Create an order from POS frontend and then seelct Journal enter some amount and then add another journal and enter value in it then again goes to first line and modify value, the value get modified in last line(i.e. second one).

For detail check the bug https://bugs.launchpad.net/openobject-addons/+bug/1207373.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

LGTM

review: Approve

Unmerged revisions

9349. By Mohammed Shekha<email address hidden>

[FIX]Refixed the issue of numpadState buffer, changing focus adds character of last changed payment line to current line.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'point_of_sale/static/src/js/screens.js'
--- point_of_sale/static/src/js/screens.js 2013-07-08 14:55:22 +0000
+++ point_of_sale/static/src/js/screens.js 2013-08-07 19:10:35 +0000
@@ -933,6 +933,10 @@
933 }933 }
934 if(this.focusedLine){934 if(this.focusedLine){
935 this.focusedLine.focus();935 this.focusedLine.focus();
936 var val = this.focusedLine.$('input')[0].value.slice(0, -3);
937 if(this.numpadState){
938 this.numpadState.set({"buffer": val.toString()});
939 }
936 }940 }
937 },941 },
938 addPaymentLine: function(newPaymentLine) {942 addPaymentLine: function(newPaymentLine) {
@@ -1003,7 +1007,11 @@
1003 this.numpadState.set({mode: 'payment'});1007 this.numpadState.set({mode: 'payment'});
1004 },1008 },
1005 set_value: function(val) {1009 set_value: function(val) {
1006 this.currentPaymentLines.last().set_amount(val);1010 if(this.focusedLine) {
1011 this.focusedLine.payment_line.set_amount(val);
1012 } else {
1013 this.currentPaymentLines.last().set_amount(val);
1014 }
1007 },1015 },
1008 });1016 });
1009}1017}
10101018
=== modified file 'point_of_sale/static/src/js/widgets.js'
--- point_of_sale/static/src/js/widgets.js 2013-07-08 14:55:22 +0000
+++ point_of_sale/static/src/js/widgets.js 2013-08-07 19:10:35 +0000
@@ -332,12 +332,19 @@
332 this.$('input').keyup(function(event){332 this.$('input').keyup(function(event){
333 self.changeAmount(event);333 self.changeAmount(event);
334 });334 });
335 this.$('input').focus(function() {
336 self.pos_widget.payment_screen.line_refocus(self);
337 });
335 this.$('.delete-payment-line').click(function() {338 this.$('.delete-payment-line').click(function() {
336 self.trigger('delete_payment_line', self);339 self.trigger('delete_payment_line', self);
337 });340 });
338 },341 },
339 focus: function(){342 focus: function(){
340 var val = this.$('input')[0].value;343 var val = this.$('input')[0].value;
344 //Check whether input has focus(this.$('input').is(":focus")),
345 //if in future focus is set using jQuery focus method
346 //Currently it does not goes to recursion because here we used basic DOM focus method
347 //otherwise focus is binded on input and calls line_refocus which again calls this method
341 this.$('input')[0].focus();348 this.$('input')[0].focus();
342 this.$('input')[0].value = val;349 this.$('input')[0].value = val;
343 this.$('input')[0].select();350 this.$('input')[0].select();