pos_customer_required.js 853 B

1234567891011121314151617181920212223242526
  1. openerp.pos_customer_required = function(instance){
  2. var QWeb = instance.web.qweb,
  3. _t = instance.web._t;
  4. var module = instance.point_of_sale;
  5. module.PaymentScreenWidget.include({
  6. validate_order: function(options) {
  7. var self = this;
  8. options = options || {};
  9. var currentOrder = this.pos.get('selectedOrder');
  10. if( this.pos.config.require_customer && !currentOrder.get_client()){
  11. self.pos_widget.screen_selector.show_popup('error',{
  12. message: _t('An anonymous order cannot be confirmed'),
  13. comment: _t('Please select a client for this order. This can be done by clicking the order tab')
  14. });
  15. return;
  16. }
  17. // else
  18. return this._super(options);
  19. }
  20. });
  21. };