diff --git a/tine20/Sales/js/InvoiceEditDialog.js b/tine20/Sales/js/InvoiceEditDialog.js index 9558825c08..85c67adec9 100644 --- a/tine20/Sales/js/InvoiceEditDialog.js +++ b/tine20/Sales/js/InvoiceEditDialog.js @@ -195,6 +195,14 @@ Tine.Sales.InvoiceEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, { } }, + onAfterRecordLoad: function () { + this.supr().onAfterRecordLoad.apply(this, arguments); + + if (!this.record.id) { + this.getForm().findField('type').setValue('INVOICE'); + } + }, + /** * loads the address to the plaintext field */ diff --git a/tine20/Sales/js/Model/Document/AbstractMixin.js b/tine20/Sales/js/Model/Document/AbstractMixin.js index 1dccd514a3..05fbbe348d 100644 --- a/tine20/Sales/js/Model/Document/AbstractMixin.js +++ b/tine20/Sales/js/Model/Document/AbstractMixin.js @@ -27,5 +27,8 @@ Tine.Sales.Model.Document_OfferMixin = AbstractMixin Tine.Sales.Model.Document_OrderMixin = AbstractMixin Tine.Sales.Model.Document_DeliveryMixin = AbstractMixin Tine.Sales.Model.Document_InvoiceMixin = AbstractMixin +Tine.Sales.Model.Document_CustomerMixin = AbstractMixin +Tine.Sales.Model.InvoiceMixin = AbstractMixin +Tine.Sales.Model.CustomerMixin = AbstractMixin export default AbstractMixin