mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
fix: Dont allow adding same item in another row
This commit is contained in:
parent
3dc893f00a
commit
827ecfd809
@ -10,7 +10,15 @@ module.exports = {
|
||||
label: 'Item',
|
||||
fieldtype: 'Link',
|
||||
target: 'Item',
|
||||
required: 1
|
||||
required: 1,
|
||||
getFilters(_, doc) {
|
||||
let items = doc.parentdoc.items.map(d => d.item).filter(Boolean);
|
||||
if (items.length > 0) {
|
||||
return {
|
||||
name: ['not in', items]
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldname: 'description',
|
||||
|
@ -10,7 +10,15 @@ module.exports = {
|
||||
label: 'Item',
|
||||
fieldtype: 'Link',
|
||||
target: 'Item',
|
||||
required: 1
|
||||
required: 1,
|
||||
getFilters(_, doc) {
|
||||
let items = doc.parentdoc.items.map(d => d.item).filter(Boolean);
|
||||
if (items.length > 0) {
|
||||
return {
|
||||
name: ['not in', items]
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldname: 'description',
|
||||
|
Loading…
Reference in New Issue
Block a user