Merge pull request '3433-supplier_account get countryFk in model.js' (#831) from 3433-supplier_account into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #831 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
9f7e4a059b
|
@ -7,12 +7,14 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function ibanValidation(err, done) {
|
async function ibanValidation(err, done) {
|
||||||
let filter = {
|
const supplier = await Self.app.models.Supplier.findById(this.supplierFk);
|
||||||
|
const filter = {
|
||||||
fields: ['code'],
|
fields: ['code'],
|
||||||
where: {id: this.countryFk}
|
where: {id: supplier.countryFk}
|
||||||
};
|
};
|
||||||
let country = await Self.app.models.Country.findOne(filter);
|
|
||||||
let code = country ? country.code.toLowerCase() : null;
|
const country = await Self.app.models.Country.findOne(filter);
|
||||||
|
const code = country ? country.code.toLowerCase() : null;
|
||||||
if (code != 'es')
|
if (code != 'es')
|
||||||
return done();
|
return done();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue