refs #5275 fix: al añadir artículo desde cero se muestra el nombre y se establecen las fechas por defecto
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-03-28 10:30:02 +02:00
parent 06ac8f9910
commit fb1b39da17
3 changed files with 14 additions and 3 deletions

View File

@ -87,7 +87,7 @@ module.exports = Self => {
await targetItem.updateAttributes({ await targetItem.updateAttributes({
minPrice: args.minPrice, minPrice: args.minPrice,
hasMinPrice: args.hasMinPrice hasMinPrice: args.hasMinPrice ? args.hasMinPrice : false
}, myOptions); }, myOptions);
const itemFields = [ const itemFields = [

View File

@ -64,6 +64,7 @@
<tr ng-repeat="price in prices"> <tr ng-repeat="price in prices">
<td shrink-field> <td shrink-field>
<vn-autocomplete <vn-autocomplete
vn-id="itemFk"
class="dense" class="dense"
url="Items/withName" url="Items/withName"
ng-model="price.itemFk" ng-model="price.itemFk"
@ -88,7 +89,7 @@
ng-if="price.itemFk" ng-if="price.itemFk"
ng-click="itemDescriptor.show($event, price.itemFk)" ng-click="itemDescriptor.show($event, price.itemFk)"
class="link"> class="link">
{{price.name}} {{itemFk.selection.name}}
</span> </span>
<vn-one ng-if="price.subName"> <vn-one ng-if="price.subName">
<h3 title="{{price.subName}}">{{price.subName}}</h3> <h3 title="{{price.subName}}">{{price.subName}}</h3>

View File

@ -36,7 +36,17 @@ export default class Controller extends Section {
if (!this.$.model.data || this.$.model.data.length == 0) { if (!this.$.model.data || this.$.model.data.length == 0) {
this.$.model.data = []; this.$.model.data = [];
this.$.model.proxiedData = []; this.$.model.proxiedData = [];
this.$.model.insert({});
const today = Date.vnNew();
const millisecsInDay = 86400000;
const daysInWeek = 7;
const nextWeek = new Date(today.getTime() + daysInWeek * millisecsInDay);
this.$.model.insert({
started: today,
ended: nextWeek
});
return; return;
} }