Duplikater av produkter i AddStockMenu fører nå til addisjon av antall.
This commit is contained in:
parent
1330c05b08
commit
2557b2ab52
|
@ -1185,7 +1185,7 @@ much money you're due in credits for the purchase when prompted.
|
||||||
}[not not self.user,len(self.products) > 0])
|
}[not not self.user,len(self.products) > 0])
|
||||||
|
|
||||||
# Read in a 'thing' (product or user):
|
# Read in a 'thing' (product or user):
|
||||||
tres = self.input_multiple(add_nonexisting=('user',),
|
tres = self.input_multiple(add_nonexisting=('user','product'),
|
||||||
empty_input_permitted=True)
|
empty_input_permitted=True)
|
||||||
if tres:
|
if tres:
|
||||||
(thing, amount) = tres
|
(thing, amount) = tres
|
||||||
|
@ -1235,8 +1235,8 @@ much money you're due in credits for the purchase when prompted.
|
||||||
else:
|
else:
|
||||||
self.user = thing
|
self.user = thing
|
||||||
elif thing in self.products.keys():
|
elif thing in self.products.keys():
|
||||||
print 'Already added this product, rewriting amount'
|
print 'Already added this product, adding amounts'
|
||||||
self.products[thing] = amount
|
self.products[thing] += amount
|
||||||
else:
|
else:
|
||||||
self.products[thing] = amount
|
self.products[thing] = amount
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue