diff --git a/layouts/v7/modules/Mobile/simple/Vtiger/js/Edit.js b/layouts/v7/modules/Mobile/simple/Vtiger/js/Edit.js index eef413183dddf69eb55b8f4b4a52e63ab33bd61b..c0012c497dd92bec970e70d5db522bf3f0fceb70 100644 --- a/layouts/v7/modules/Mobile/simple/Vtiger/js/Edit.js +++ b/layouts/v7/modules/Mobile/simple/Vtiger/js/Edit.js @@ -19,9 +19,6 @@ mobileapp.controller('VtigerEditController', function ($scope, $api, $mdToast, $ if(newrecord){ if (typeof field.default != 'undefined') field.raw = field.default; else if (typeof field.type.defaultValue != 'undefined') field.raw = field.type.defaultValue; - - // Special case - if (field.type.name == 'owner' && field.mandatory && !field.raw) { field.raw = "19x" + $scope.userinfo.id; } } if(!newrecord && value){ field.raw = value; diff --git a/packages/vtiger/mandatory/Mobile.zip b/packages/vtiger/mandatory/Mobile.zip index a9f0af45a4a79024b1a3510a74d56f79a2081116..eb756d8ec80ed7e97b49283196a203b492b22b5b 100644 Binary files a/packages/vtiger/mandatory/Mobile.zip and b/packages/vtiger/mandatory/Mobile.zip differ diff --git a/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Describe.php b/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Describe.php index 00d04b56ab2e8c34bfa76893f262dcffbf8ecd6f..5fee0d5dc9f9e6b1835dcc842cef02f9100fbe65 100644 --- a/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Describe.php +++ b/pkg/vtiger/modules/Mobile/modules/Mobile/api/ws/Describe.php @@ -42,7 +42,12 @@ class Mobile_WS_Describe extends Mobile_WS_Controller { $groups[$groupsWSId.'x'.$id] = $name; } $field['type']['picklistValues']['users'] = $users; - $field['type']['picklistValues']['groups'] = $groups; + $field['type']['picklistValues']['groups'] = $groups; + + //Special treatment to set default mandatory owner field + if (!$field['default']) { + $field['default'] = $usersWSId.'x'.$current_user->id; + } } if($fieldModel && $fieldModel->get('name') == 'salutationtype') { $values = $fieldModel->getPicklistValues();