Make sure alt unit is an order unit when using amount per piece

This commit is contained in:
Marcus Lindvall 2019-12-09 10:36:06 +01:00
parent 1a7ada9d56
commit f649b5f953

View file

@ -151,8 +151,9 @@ class Article(RawBaseModel):
for unit in self.ArticleUnit: for unit in self.ArticleUnit:
if unit.AltEnhetOrderStd == "1" and not spec_conv: if unit.AltEnhetOrderStd == "1" and not spec_conv:
return unit return unit
elif (spec_conv and (unit.AltEnhetOmrFaktor == spec_conv or elif (spec_conv and unit.AltEnhetOrder == "1" and (
unit.ArticleAlternativeUnit.AltEnhetOmrFaktor == spec_conv)): unit.AltEnhetOmrFaktor == spec_conv or
unit.ArticleAlternativeUnit.AltEnhetOmrFaktor == spec_conv)):
return unit return unit
def get_unit_conv(self): def get_unit_conv(self):