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
1=== modified file 'point_of_sale/static/src/js/screens.js'
2--- point_of_sale/static/src/js/screens.js 2013-07-08 14:55:22 +0000
3+++ point_of_sale/static/src/js/screens.js 2013-08-07 19:10:35 +0000
4@@ -933,6 +933,10 @@
5 }
6 if(this.focusedLine){
7 this.focusedLine.focus();
8+ var val = this.focusedLine.$('input')[0].value.slice(0, -3);
9+ if(this.numpadState){
10+ this.numpadState.set({"buffer": val.toString()});
11+ }
12 }
13 },
14 addPaymentLine: function(newPaymentLine) {
15@@ -1003,7 +1007,11 @@
16 this.numpadState.set({mode: 'payment'});
17 },
18 set_value: function(val) {
19- this.currentPaymentLines.last().set_amount(val);
20+ if(this.focusedLine) {
21+ this.focusedLine.payment_line.set_amount(val);
22+ } else {
23+ this.currentPaymentLines.last().set_amount(val);
24+ }
25 },
26 });
27 }
28
29=== modified file 'point_of_sale/static/src/js/widgets.js'
30--- point_of_sale/static/src/js/widgets.js 2013-07-08 14:55:22 +0000
31+++ point_of_sale/static/src/js/widgets.js 2013-08-07 19:10:35 +0000
32@@ -332,12 +332,19 @@
33 this.$('input').keyup(function(event){
34 self.changeAmount(event);
35 });
36+ this.$('input').focus(function() {
37+ self.pos_widget.payment_screen.line_refocus(self);
38+ });
39 this.$('.delete-payment-line').click(function() {
40 self.trigger('delete_payment_line', self);
41 });
42 },
43 focus: function(){
44 var val = this.$('input')[0].value;
45+ //Check whether input has focus(this.$('input').is(":focus")),
46+ //if in future focus is set using jQuery focus method
47+ //Currently it does not goes to recursion because here we used basic DOM focus method
48+ //otherwise focus is binded on input and calls line_refocus which again calls this method
49 this.$('input')[0].focus();
50 this.$('input')[0].value = val;
51 this.$('input')[0].select();