123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- const state = {
- currencies: []
- }
- const getters = {
- getCurrencies(state) {
- return state.currencies
- }
- }
- const mutations = {
- pushCurrencies(state, payload) {
- state.currencies = payload.currencies
- }
- }
- const actions = {
- fetchCurrencies({ commit, dispatch }) {
- return new Promise((resolve, reject) => {
- let pos = new openerp.web.Model('res.currency')
- ResCurrency.call('get_currencies').then(response => {
- commit('pushCurrencies', {
- currencies: response
- })
- dispatch('loaded', {
- module: 'currencies'
- })
- resolve()
- }).fail(error => {
- console.log(error);
- reject(error)
- })
- })
- }
- }
- export default {
- state,
- getters,
- mutations,
- actions
- }
|