File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ odoo.define('pos_payment_wechat', function(require){
58
58
} ) ;
59
59
60
60
} ,
61
+ scan_product : function ( parsed_code ) {
62
+ // TODO: do we need to make this optional?
63
+ var value = parsed_code . code ;
64
+ if ( this . wechat . check_auth_code ( value ) ) {
65
+ this . wechat . process_qr ( value ) ;
66
+ return true ;
67
+ }
68
+ return PosModelSuper . prototype . scan_product . apply ( this , arguments ) ;
69
+ } ,
61
70
on_micropay : function ( msg ) {
62
71
var order = this . get ( 'orders' ) . find ( function ( item ) {
63
72
return item . uid === msg . order_ref ;
@@ -117,7 +126,7 @@ odoo.define('pos_payment_wechat', function(require){
117
126
} ) ;
118
127
} ,
119
128
check_auth_code : function ( code ) {
120
- return true ; // for DEBUG
129
+ // TODO: do we need to integrate this with barcode.nomenclature?
121
130
if ( code && Number . isInteger ( + code ) &&
122
131
code . length === 18 &&
123
132
+ code [ 0 ] === 1 && ( + code [ 1 ] >= 0 && + code [ 1 ] <= 5 ) ) {
You can’t perform that action at this time.
0 commit comments