fix: logged in user as default assigned_to
This commit is contained in:
parent
7222fa9279
commit
f99529e499
@ -93,6 +93,7 @@ import {
|
|||||||
call,
|
call,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { ref, defineModel, h, watch, nextTick } from 'vue'
|
import { ref, defineModel, h, watch, nextTick } from 'vue'
|
||||||
|
import { get } from '@vueuse/core'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
task: {
|
task: {
|
||||||
@ -110,6 +111,8 @@ const tasks = defineModel('reloadTasks')
|
|||||||
|
|
||||||
const emit = defineEmits(['updateTask'])
|
const emit = defineEmits(['updateTask'])
|
||||||
|
|
||||||
|
const { getUser } = usersStore()
|
||||||
|
|
||||||
const title = ref(null)
|
const title = ref(null)
|
||||||
const editMode = ref(false)
|
const editMode = ref(false)
|
||||||
const _task = ref({
|
const _task = ref({
|
||||||
@ -121,8 +124,6 @@ const _task = ref({
|
|||||||
priority: 'Low',
|
priority: 'Low',
|
||||||
})
|
})
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
|
||||||
|
|
||||||
function updateTaskStatus(status) {
|
function updateTaskStatus(status) {
|
||||||
_task.value.status = status
|
_task.value.status = status
|
||||||
}
|
}
|
||||||
@ -132,6 +133,9 @@ function updateTaskPriority(priority) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function updateTask(close) {
|
async function updateTask(close) {
|
||||||
|
if (!_task.value.assigned_to) {
|
||||||
|
_task.value.assigned_to = getUser().email
|
||||||
|
}
|
||||||
if (_task.value.name) {
|
if (_task.value.name) {
|
||||||
let d = await call('frappe.client.set_value', {
|
let d = await call('frappe.client.set_value', {
|
||||||
doctype: 'CRM Task',
|
doctype: 'CRM Task',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user