Hotfix: Clone option added to vnItemDescriptor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-05-13 17:51:27 +02:00
parent 134b4be136
commit b94c97d322
2 changed files with 14 additions and 2 deletions

View File

@ -99,4 +99,10 @@
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
</vn-dialog>
<vn-confirm
vn-id="clone"
on-accept="$ctrl.onCloneAccept()"
question="Do you want to clone this item?"
message="All it's properties will be copied">
</vn-confirm>

View File

@ -6,7 +6,8 @@ class Controller extends Component {
constructor($element, $) {
super($element, $);
this.moreOptions = [
{callback: this.showRegularizeDialog, name: 'Regularize stock'}
{callback: this.showRegularizeDialog, name: 'Regularize stock'},
{callback: () => this.$.clone.show(), name: 'Clone'}
];
}
@ -88,6 +89,11 @@ class Controller extends Component {
this.warehouseFk = null;
this.quantity = null;
}
onCloneAccept() {
this.$http.post(`Items/${this.item.id}/clone`)
.then(res => this.$state.go('item.card.tags', {id: res.data.id}));
}
}
Controller.$inject = ['$element', '$scope'];