Merge pull request 'refs #5339 data' (!1623) from 5339_instance_vs_data into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1623 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
207dcacf0f
|
@ -1,10 +1,10 @@
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
Self.observe('after save', async function(ctx) {
|
Self.observe('after save', async function(ctx) {
|
||||||
const instance = ctx.instance;
|
const instance = ctx.data || ctx.instance;
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const options = ctx.options;
|
const options = ctx.options;
|
||||||
|
|
||||||
if (!instance.sectorFk || !instance.labelerFk) return;
|
if (!instance?.sectorFk || !instance?.labelerFk) return;
|
||||||
|
|
||||||
const sector = await models.Sector.findById(instance.sectorFk, {
|
const sector = await models.Sector.findById(instance.sectorFk, {
|
||||||
fields: ['mainPrinterFk']
|
fields: ['mainPrinterFk']
|
||||||
|
|
|
@ -16,18 +16,12 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"trainFk": {
|
"trainFk": {
|
||||||
"type": "number",
|
"type": "number"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
"itemPackingTypeFk": {
|
"itemPackingTypeFk": {
|
||||||
"type": "string",
|
"type": "string"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
"warehouseFk": {
|
"warehouseFk": {
|
||||||
"type": "number",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"sectorFk": {
|
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"labelerFk": {
|
"labelerFk": {
|
||||||
|
|
Loading…
Reference in New Issue