This commit is contained in:
seb
2026-10-28 00:41:31 +01:00
parent 23e4a0951c
commit 0453680c59
14 changed files with 47 additions and 83 deletions

View File

@@ -98,8 +98,7 @@ export default class BookDeliveryDialog extends PureComponent {
loadSupplierArticlesIfNeeded() {
const supplierId = this.props.delivery?.supplierId ?? this.props.delivery?.partyId;
if (supplierId && Object.keys(this.state.supplierArticlesMap).length === 0) {
void supplierApi.getArticles(supplierId).then((res) => {
const articles = res?.articles || res?.supplier?.articles || [];
void companyAutomat.actions.loadArticlesForSupplier(supplierId).then((articles) => {
const map = buildSupplierArticlesMap(articles);
this.setState({ supplierArticlesMap: map });
}).catch(() => { });
@@ -122,7 +121,6 @@ export default class BookDeliveryDialog extends PureComponent {
this.unsubArticle = artikelAutomat.subscribe(() => {
this.forceUpdate();
});
void companyAutomat.actions.loadWarehouses().catch(() => { });
this.loadSupplierArticlesIfNeeded();
if (this.props.open) {
@@ -225,7 +223,6 @@ export default class BookDeliveryDialog extends PureComponent {
supplierArticlesMap: currentSupplierMap,
},
() => {
void companyAutomat.actions.loadWarehouses().catch(() => { });
this.loadSupplierArticlesIfNeeded();
if (this.props.summary) {
this.initAmountsFromSummary(this.props.summary, this.props.prefillLineId);

View File

@@ -242,10 +242,6 @@ class ManifestForm extends PureComponent {
['current', 'suppliers', 'suppliersStatus', 'customergroups', 'customergroupsStatus'],
);
if (companyAutomat.state.warehousesStatus === 'idle') {
void companyAutomat.actions.loadWarehouses();
}
if (this.props.mode === 'edit') {
void this.loadEdit();
if (this.props.kind === 'order' || this.props.kind === 'retoure') {