Skip to content

Commit

Permalink
feature(Sales): Personal contacts can not be used for customers
Browse files Browse the repository at this point in the history
  • Loading branch information
jevers authored and pschuele committed Nov 20, 2024
1 parent 65d043f commit ca928ed
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tine20/Sales/js/CustomerEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,18 @@ Tine.Sales.CustomerEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
form.findField('adr_' + ar[index]).setValue(record.get('adr_one_' + ar[index]));
}
}
this.onSelectContact(combo, record)
},


onSelectContact: function (combo, record) {
const type = record.get('container_id').type
if (type === 'personal') {
combo.markInvalid(this.app.i18n._('Must not be a personal contact'))
} else {
combo.clearInvalid()
}
},

/**
* returns dialog
*
Expand Down Expand Up @@ -198,14 +208,20 @@ Tine.Sales.CustomerEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
listeners: {
scope: this,
select: this.onSelectContactPerson
}
},
validate: Ext.emptyFn
}), Tine.widgets.form.RecordPickerManager.get('Addressbook', 'Contact', {
columnWidth: .5,
blurOnSelect: true,
name: 'cpintern_id',
allowBlank: true,
fieldLabel: this.app.i18n._('Contact Person (internal)')
})
fieldLabel: this.app.i18n._('Contact Person (internal)'),
listeners: {
scope: this,
select: this.onSelectContact
},
validate: Ext.emptyFn
})
]]
}]
}, {
Expand Down
3 changes: 3 additions & 0 deletions tine20/Sales/translations/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -2464,3 +2464,6 @@ msgstr "Hinzufügen, bearbeiten und löschen von Geschäftsbereichen"

#~ msgid "Possible Delivery Note Status Transitions"
#~ msgstr "Mögliche Lieferscheinstatus-Übergänge"

msgid "Must not be a personal contact"
msgstr "Darf kein persönlicher Kontakt sein"
3 changes: 3 additions & 0 deletions tine20/Sales/translations/template.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2323,3 +2323,6 @@ msgstr ""
#: Acl/Rights.php:240
msgid "Add, edit and delete divisions"
msgstr ""

msgid "Must not be a personal contact"
msgstr ""

0 comments on commit ca928ed

Please sign in to comment.