const state = { company: null } const getters = { getCompany(state) { return state.company }, getDefaultCurrency(state) { return state.company ? state.company.currency : '' } } const mutations = { setCompany(state, payload) { state.company = payload.company } } const actions = { fetchCompany({ commit }) { let pos = new openerp.web.Model('eiru.pos') pos.call('get_company').then(response => { commit('setCompany', { company: response }) }).fail(error => { console.log(error) }) } } export default { state, getters, mutations, actions }