Fix: Rate contract update.

This commit is contained in:
2025-07-17 11:05:57 +00:00
parent b1d5ff7df6
commit 0a60a4be6a
3 changed files with 3 additions and 1 deletions

View File

@ -108,6 +108,7 @@ def update_items(rate_contract: RateContract, items: list[RateContractItemSchema
else: else:
db.delete(item) db.delete(item)
rate_contract.items.remove(item) rate_contract.items.remove(item)
db.flush()
add_items(rate_contract, items, db) add_items(rate_contract, items, db)

View File

@ -61,7 +61,7 @@
[displayWith]="displayFn" [displayWith]="displayFn"
(optionSelected)="productSelected($event)" (optionSelected)="productSelected($event)"
> >
@for (product of products | async; track product) { @for (product of products | async; track product.id) {
<mat-option [value]="product">{{ product.name }}</mat-option> <mat-option [value]="product">{{ product.name }}</mat-option>
} }
</mat-autocomplete> </mat-autocomplete>

View File

@ -137,6 +137,7 @@ export class RateContractDetailComponent implements OnInit, AfterViewInit {
}, },
narration: this.item.narration, narration: this.item.narration,
}); });
this.account = this.item.vendor || null;
this.dataSource = new RateContractDetailDatasource(this.itemsObservable); this.dataSource = new RateContractDetailDatasource(this.itemsObservable);
this.updateView(); this.updateView();
} }