mirror of
https://github.com/frappe/books.git
synced 2024-12-22 19:09:01 +00:00
fix: set numberSeries as readOnly after insert
This commit is contained in:
parent
54628bb2d1
commit
ceb45b58b7
@ -69,6 +69,10 @@ export default class Document extends Observable {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fieldname === 'numberSeries' && !this._notInserted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this[fieldname] !== value) {
|
||||
this._dirty = true;
|
||||
// if child is dirty, parent is dirty too
|
||||
|
@ -86,10 +86,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import Button from '@/components/Button';
|
||||
import { handleErrorWithDialog, getErrorMessage } from '../errorHandling';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import frappe from 'frappe';
|
||||
import { getErrorMessage, handleErrorWithDialog } from '../errorHandling';
|
||||
|
||||
let TwoColumnForm = {
|
||||
name: 'TwoColumnForm',
|
||||
@ -153,6 +153,10 @@ let TwoColumnForm = {
|
||||
}
|
||||
},
|
||||
evaluateReadOnly(df) {
|
||||
if (df.fieldname === 'numberSeries' && !this.doc._notInserted) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.submitted) {
|
||||
return true;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@
|
||||
:df="meta.getField('numberSeries')"
|
||||
:value="doc.numberSeries"
|
||||
@change="(value) => doc.set('numberSeries', value)"
|
||||
:read-only="doc.submitted"
|
||||
:read-only="!doc._notInserted || doc.submitted"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -205,11 +205,11 @@ import DropdownWithActions from '@/components/DropdownWithActions';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import StatusBadge from '@/components/StatusBadge';
|
||||
import {
|
||||
getActionsForDocument,
|
||||
getInvoiceStatus,
|
||||
openSettings,
|
||||
routeTo,
|
||||
showMessageDialog
|
||||
getActionsForDocument,
|
||||
getInvoiceStatus,
|
||||
openSettings,
|
||||
routeTo,
|
||||
showMessageDialog,
|
||||
} from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
import { handleErrorWithDialog } from '../errorHandling';
|
||||
|
@ -84,7 +84,7 @@
|
||||
:value="doc.numberSeries"
|
||||
@change="(value) => doc.set('numberSeries', value)"
|
||||
input-class="bg-gray-100 p-2 text-base"
|
||||
:read-only="doc.submitted"
|
||||
:read-only="!doc._notInserted || doc.submitted"
|
||||
:class="doc.submitted && 'pointer-events-none'"
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user