Duplikater av produkter i AddStockMenu fører nå til addisjon av antall.

This commit is contained in:
Øyvind Almelid 2011-06-07 09:30:02 +00:00
parent 1330c05b08
commit 2557b2ab52
1 changed files with 3 additions and 3 deletions

View File

@ -1185,7 +1185,7 @@ much money you're due in credits for the purchase when prompted.
}[not not self.user,len(self.products) > 0])
# 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)
if tres:
(thing, amount) = tres
@ -1235,8 +1235,8 @@ much money you're due in credits for the purchase when prompted.
else:
self.user = thing
elif thing in self.products.keys():
print 'Already added this product, rewriting amount'
self.products[thing] = amount
print 'Already added this product, adding amounts'
self.products[thing] += amount
else:
self.products[thing] = amount