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){
5858 } ) ;
5959
6060 } ,
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+ } ,
6170 on_micropay : function ( msg ) {
6271 var order = this . get ( 'orders' ) . find ( function ( item ) {
6372 return item . uid === msg . order_ref ;
@@ -117,7 +126,7 @@ odoo.define('pos_payment_wechat', function(require){
117126 } ) ;
118127 } ,
119128 check_auth_code : function ( code ) {
120- return true ; // for DEBUG
129+ // TODO: do we need to integrate this with barcode.nomenclature?
121130 if ( code && Number . isInteger ( + code ) &&
122131 code . length === 18 &&
123132 + code [ 0 ] === 1 && ( + code [ 1 ] >= 0 && + code [ 1 ] <= 5 ) ) {
You can’t perform that action at this time.
0 commit comments