[FIX] point_of_sale: close button doesn't crash anymore

bzr revid: fva@openerp.com-20120713153719-256zclhnwzvq52qf
This commit is contained in:
Frédéric van der Essen 2012-07-13 17:37:19 +02:00
parent 7fa6ccb47e
commit db172f2531
2 changed files with 9 additions and 32 deletions

View File

@ -506,11 +506,14 @@
<field colspan="4" name="account_control_ids" nolabel="1"/>
</page>
<page string="Cash">
<separator string="Profit &amp; Loss Accounts" colspan="4" />
<field name="profit_account_id" />
<field name="loss_account_id" />
<separator string="Internal Account" colspan="4" />
<field name="internal_account_id" />
<group string="Profit &amp; Loss Accounts">
<field name="profit_account_id" />
<field name="loss_account_id" />
</group>
<group string="Internal Transfer Account">
<field name="internal_account_id" />
</group>
<separator string="Available Currencies" colspan="4" />
<field name="cashbox_line_ids" nolabel="1" string="Unit Of Currency Definition" colspan="4">

View File

@ -871,32 +871,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
var self = this;
self.pos.flush().then(function() {
self.close();
/*
if (self.pos.get('nbr_pending_operations').length > 0) {
var confirm = false;
$(QWeb.render('PosCloseWarning')).dialog({
resizable: false,
height:160,
modal: true,
title: "Warning",
buttons: {
"Yes": function() {
confirm = true;
$( this ).dialog( "close" );
},
"No": function() {
$( this ).dialog( "close" );
}
},
close: function() {
if (confirm){
close();
}
}
});
} else {
close();
}*/
});
},
close: function() {
@ -905,7 +879,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
_.bind(function(res) {
return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) {
var action = result.result;
action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'default_home'}});
action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'reload'}});
this.do_action(action);
}, this));
}, this));