index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. import store from '@/store'
  4. /*config*/
  5. Vue.config.productionTip = false
  6. Vue.config.silent = true
  7. Vue.config.devTools = false
  8. openerp.eiru_payments_purchases = (instance, local) => {
  9. local.PaymentsPurchasesWidget = instance.Widget.extend({
  10. start() {
  11. this.sidebarFold()
  12. this.vm = new Vue({
  13. store,
  14. el: this.el,
  15. template: '<App />',
  16. components: {
  17. App
  18. }
  19. });
  20. },
  21. destroy() {
  22. this.vm.$destroy()
  23. $(this.vm.$el).remove()
  24. this.vm =null
  25. this.sidebarUnFold()
  26. this._super.apply(this, arguments)
  27. },
  28. sidebarFold() {
  29. if (!instance.eiru_sidebar_toggler) return
  30. instance.eiru_sidebar_toggler.sidebar_fold()
  31. },
  32. sidebarUnFold() {
  33. if(!instance.eiru_sidebar_toggler) return
  34. instance.eiru_sidebar_toggler.sidebar_unfold()
  35. }
  36. })
  37. instance.web.client_actions.add('eiru_payments_purchases.action_launch', 'instance.eiru_payments_purchases.PaymentsPurchasesWidget')
  38. }