|
@@ -54,14 +54,38 @@ const actions = {
|
|
context: new openerp.web.CompoundContext()
|
|
context: new openerp.web.CompoundContext()
|
|
}).then(response => {
|
|
}).then(response => {
|
|
window.location.reload()
|
|
window.location.reload()
|
|
|
|
+
|
|
|
|
+ dispatch('printInvoice', response)
|
|
|
|
+
|
|
resolve(response)
|
|
resolve(response)
|
|
}).fail(error => {
|
|
}).fail(error => {
|
|
reject(error)
|
|
reject(error)
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- reset({ state }) {
|
|
|
|
- console.log(state)
|
|
|
|
|
|
+ printInvoice({ getters }, payload) {
|
|
|
|
+ let self = getters.posInstance
|
|
|
|
+
|
|
|
|
+ let active_ids = {
|
|
|
|
+ active_id: payload.invoice_id,
|
|
|
|
+ active_ids: [payload.invoice_id],
|
|
|
|
+ active_model: 'account.invoice'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ self.rpc('/web/action/load', {
|
|
|
|
+ action_id: payload.action_id,
|
|
|
|
+ context: new openerp.web.CompoundContext(active_ids).eval()
|
|
|
|
+ }).then(result => {
|
|
|
|
+ result.context = new openerp.web.CompoundContext(active_ids).eval();
|
|
|
|
+ result.flags = result.flags || {};
|
|
|
|
+ result.flags.new_window = true;
|
|
|
|
+
|
|
|
|
+ self.do_action(result, {
|
|
|
|
+ on_close: function () {
|
|
|
|
+ self.getParent().reload();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|