Browse Source

[IMP] some modules and functions names renamed

Gogs 7 years ago
parent
commit
547b3d6d38
5 changed files with 23 additions and 9 deletions
  1. 3 0
      models/eiru_pos.py
  2. 5 4
      src/App.vue
  3. 5 4
      src/store/actions.js
  4. 3 1
      src/store/index.js
  5. 7 0
      src/store/mutations.js

+ 3 - 0
models/eiru_pos.py

@@ -184,6 +184,9 @@ class EiruPOS(models.Model):
         
 
         return customers
+
+    def create_order(self):
+        print 'ok'
         
 
 class eiru_pos_session(models.Model):

+ 5 - 4
src/App.vue

@@ -1,6 +1,6 @@
 <template lang="pug">
     .pos
-        form-wizard(title="" subtitle="" nextButtonText="Continuar" backButtonText="Volver" finishButtonText="Finalizar" color="#7c7bad")
+        form-wizard(title="" subtitle="" finishButtonText="Finalizar" color="#7c7bad" nextButtonText="Continuar" backButtonText="Volver" @on-complete="completeSale()")
             tab-content(title="Agregue productos al carrito" :before-change="checkCart")
                 .products
                     .products-container
@@ -70,12 +70,13 @@
                 return this.hasSelectedCustomer
             },
             ...mapActions([
-                'fetchData',
-                'notify'
+                'initSale',
+                'notify',
+                'completeSale'
             ])
         },
         mounted() {
-            this.fetchData()
+            this.initSale()
         }
     }
 </script>

+ 5 - 4
src/store/actions.js

@@ -2,7 +2,7 @@ const actions = {
     notify({ commit }, payload) {
         openerp.web.notification.do_warn('Atención', payload)
     },
-    fetchData({ dispatch }) {
+    initSale({ dispatch }) {
         let promises = [
             dispatch('fetchCompany'),
             dispatch('fetchCurrencies'),
@@ -15,9 +15,10 @@ const actions = {
         }).catch(error => {
             console.log(error)
         })
+    },
+    completeSale({ commit }) {
+        console.log(payload)
     }
 }
 
-export default {
-    actions
-}
+export default actions

+ 3 - 1
src/store/index.js

@@ -2,6 +2,7 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 
 import actions from '@/store/actions'
+import mutations from '@/store/mutations'
 
 import loader from '@/store/modules/loader'
 import company from '@/store/modules/company'
@@ -13,7 +14,8 @@ import customers from '@/store/modules/customers'
 Vue.use(Vuex)
 
 const Store = new Vuex.Store({
-    ...actions,
+    actions,
+    mutations,
     modules: {
         loader,
         company,

+ 7 - 0
src/store/mutations.js

@@ -0,0 +1,7 @@
+const mutations = {
+    resetInitialStates(state) {
+
+    }
+}
+
+export default mutations