Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Sales): picking deliver address not possible
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusweiss committed Jun 21, 2022
1 parent c1f5e49 commit d3530da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tine20/Sales/js/AddressSearchCombo.js
Expand Up @@ -35,12 +35,14 @@ Tine.Sales.AddressSearchCombo = Ext.extend(Tine.Tinebase.widgets.form.RecordPick

checkState: function(editDialog, record) {
const mc = editDialog?.recordClass?.getModelConfiguration();
const type = _.get(mc, `fields.${this.fieldName}.config.type`, 'billing');
const type = this.type || _.get(mc, `fields.${this.fieldName}.config.type`, 'billing');

const customerField = editDialog.getForm().findField('customer_id') || editDialog.getForm().findField('customer')
const customer = customerField?.selectedRecord;
const customer_id = customer?.json?.original_id || customer?.id;

this.setDisabled(!customer_id);

if (this.customer_id && this.customer_id !== customer_id) {
// handle customer changes
this.clearValue();
Expand All @@ -56,7 +58,6 @@ Tine.Sales.AddressSearchCombo = Ext.extend(Tine.Tinebase.widgets.form.RecordPick
}
this.customer_id = customer_id;

this.setDisabled(!customer_id);
if (! customer_id) {
this.clearValue();
} else {
Expand Down

0 comments on commit d3530da

Please sign in to comment.