1234567891011121314151617181920212223242526272829303132333435363738 |
- 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
- }
|