Merge branch 'master' into test

This commit is contained in:
Juan Ferrer 2020-06-01 13:38:59 +02:00
commit 3fcb76246d
2 changed files with 18 additions and 1 deletions

View File

@ -8,6 +8,12 @@
translate>
Regularize stock
</vn-item>
<vn-item
ng-click="clone.show()"
name="cloneItem"
translate>
Clone
</vn-item>
</slot-menu>
<slot-before>
<div style="position: relative" text-center>
@ -84,3 +90,9 @@
<button response="accept" translate>Save</button>
</tpl-buttons>
</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

@ -59,6 +59,11 @@ class Controller extends Descriptor {
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}));
}
}
ngModule.vnComponent('vnItemDescriptor', {