index.js 1.1 KB

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