Bug #220 Al crear un consignatario mirar RE

This commit is contained in:
Javi Gallego 2018-03-28 10:45:09 +02:00
parent d29dcf2e11
commit 02a173da36
1 changed files with 11 additions and 0 deletions

View File

@ -45,5 +45,16 @@ module.exports = function(Self) {
};
await Self.updateAll(filter, {isDefaultAddress: false});
}
if (ctx.isNewInstance == true) {
let filter = {
where: {
id: ctx.instance.clientFk
},
fields: ['isEqualizated']
};
let findOneResponse = await Self.app.models.Client.findOne(filter);
ctx.instance.isEqualizated = findOneResponse.isEqualizated;
}
});
};