index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. import VueModal from 'vue-js-modal'
  4. // import store from '@/store'
  5. // import currency from '@/components/filters/currency'
  6. // import absolute from '@/components/filters/absolute'
  7. // Vue.filter('currency', currency)
  8. // Vue.filter('absolute', absolute)
  9. Vue.use(VueModal)
  10. Vue.config.productionTip = false
  11. Vue.config.silent = true
  12. Vue.config.devTools = true
  13. openerp.eiru_bank_statement = (instance, local) => {
  14. local.BankStatementWidget = instance.Widget.extend({
  15. init(parent, action) {
  16. this._super(parent)
  17. this.mode = action.params.mode
  18. },
  19. start() {
  20. console.log(this);
  21. this.sidebarFold()
  22. this.vm = new Vue({
  23. // store,
  24. el: this.el,
  25. template: '<App />',
  26. components: {
  27. App
  28. },
  29. data: {
  30. mode: this.mode
  31. }
  32. })
  33. },
  34. destroy() {
  35. this.vm.$destroy()
  36. $(this.vm.$el).remove()
  37. this.vm = null
  38. this.sidebarUnfold()
  39. this._super.apply(this, arguments)
  40. },
  41. sidebarFold() {
  42. if (!instance.eiru_sidebar_toggler) return
  43. instance.eiru_sidebar_toggler.sidebar_fold()
  44. },
  45. sidebarUnfold() {
  46. if (!instance.eiru_sidebar_toggler) return
  47. instance.eiru_sidebar_toggler.sidebar_unfold()
  48. }
  49. })
  50. instance.web.client_actions.add('eiru_bank_statement.action_launch', 'instance.eiru_bank_statement.BankStatementWidget')
  51. }