title: Client ODOO Error: QWeb is not defined
body: <p>I hope you could help me, I already use odoo .v8, well I'm working over Point of Sale module, and I'm tring to inherit some methods for printing, everything was good until when I redefine <strong>validate_order</strong> I get this error on client side:</p>
  
  <p><code>Uncaught ReferenceError: QWeb is not defined</code></p>
  
  <p>this is my code how I redefine <strong>validate_order</strong> method:</p>
  
  <pre class="lang-java prettyprint-override"><code> function openerp_tpv_screens(instance, module){
   var Qweb = instance.web.qweb;
   var _t = instance.web._t;
  
   module.PaymentScreenWidget=module.PaymentScreenWidget.extend({
  
   validate_order: function(options) {
          var self = this;
          options = options || {};
  
          var currentOrder = this.pos.get('selectedOrder');
  
          if(currentOrder.get('orderLines').models.length === 0){
              this.pos_widget.screen_selector.show_popup('error',{
                  'message': _t('Empty Order'),
                  'comment': _t('There must be at least one product in your order before it can be validated'),
              });
              return;
          }
  
          var plines = currentOrder.get('paymentLines').models;
          for (var i = 0; i &lt; plines.length; i++) {
              if (plines[i].get_type() === 'bank' &amp;&amp; plines[i].get_amount() &lt; 0) {
                  this.pos_widget.screen_selector.show_popup('error',{
                      'message': _t('Negative Bank Payment'),
                      'comment': _t('You cannot have a negative amount in a Bank payment. Use a cash payment method to return money to the customer.'),
                  });
                  return;
              }
          }
  
          if(!this.is_paid()){
              return;
          }
  
          // The exact amount must be paid if there is no cash payment method defined.
          if (Math.abs(currentOrder.getTotalTaxIncluded() - currentOrder.getPaidTotal()) &gt; 0.00001) {
              var cash = false;
              for (var i = 0; i &lt; this.pos.cashregisters.length; i++) {
                  cash = cash || (this.pos.cashregisters[i].journal.type === 'cash');
              }
              if (!cash) {
                  this.pos_widget.screen_selector.show_popup('error',{
                      message: _t('Cannot return change without a cash payment method'),
                      comment: _t('There is no cash payment method available in this point of sale to handle the change.\n\n Please pay the exact amount or add a cash payment method in the point of sale configuration'),
                  });
                  return;
              }
          }
  
          if (this.pos.config.iface_cashdrawer) {
                  this.pos.proxy.open_cashbox();
          }
  
          if(options.invoice){
              // deactivate the validation button while we try to send the order
              this.pos_widget.action_bar.set_button_disabled('validation',true);
              this.pos_widget.action_bar.set_button_disabled('invoice',true);
              this.pos_widget.action_bar.set_button_disabled('invoice_03',true);
  
              var invoiced = this.pos.push_and_invoice_order(currentOrder);
  
              invoiced.fail(function(error){
                  if(error === 'error-no-client' || error === 'error-generic-client'){
                      self.pos_widget.screen_selector.show_popup('error',{
                          message: _t('An anonymous order cannot be invoiced'),
                          comment: _t('Please select a client for this order. This can be done by clicking the order tab'),
                      });
                  }else if(error === 'error-no-generic-client'){
                      self.pos_widget.screen_selector.show_popup('error',{
                          message: _t('An anonymous order cannot be invoiced'),
                          comment: _t('No se debe seleccionar un Cliente Genérico.'),
                      });
                  }else{
                      self.pos_widget.screen_selector.show_popup('error',{
                          message: _t('The order could not be sent'),
                          comment: _t('Check your internet connection and try again.'),
                      });
                  }
                  self.pos_widget.action_bar.set_button_disabled('validation',false);
                  self.pos_widget.action_bar.set_button_disabled('invoice',false);
                  self.pos_widget.action_bar.set_button_disabled('invoice_03',false);
              });
  
              invoiced.done(function(){
                  self.pos_widget.action_bar.set_button_disabled('validation',false);
                  self.pos_widget.action_bar.set_button_disabled('invoice',false);
                  self.pos_widget.action_bar.set_button_disabled('invoice_03',false);
                  self.pos.get('selectedOrder').destroy();
              });
  
          }else{
              this.pos.push_order(currentOrder) 
              if(this.pos.config.iface_print_via_proxy){
                  var receipt = currentOrder.export_for_printing();
                  this.pos.proxy.print_receipt(QWeb.render('XmlReceipt',{
                      receipt: receipt, widget: self,
                  }));
                  this.pos.get('selectedOrder').destroy();    //finish order and go back to scan screen
              }else{
                  this.pos_widget.screen_selector.set_current_screen(this.next_screen);
              }
          }
  
          // hide onscreen (iOS) keyboard 
          setTimeout(function(){
              document.activeElement.blur();
              $("input").blur();
          },250);
      },
  
  });
  </code></pre>
  
  <p>the specific line that give me the error is:</p>
  
  <pre class="lang-java prettyprint-override"><code> this.pos.proxy.print_receipt(QWeb.render('XmlReceipt',{
                      receipt: receipt, widget: self,
                  }));`
  </code></pre>
  
  <p>Qweb is not defined is the error but I did it:  <code>var Qweb = instance.web.qweb;</code><a href="https://i.stack.imgur.com/IlhUF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IlhUF.png" alt="enter image description here"></a></p>
  
  <p>Thanks for your time.</p>