mindre endringer
This commit is contained in:
parent
0237f58f59
commit
109762f8e6
2
conf.py
2
conf.py
|
@ -1,4 +1,4 @@
|
||||||
db_url = 'sqlite:///data'
|
db_url = 'postgres.pvv.ntnu.no://torjehoa_dibblerdummy:1234@postgres/torjehoa_dibblerdummy'
|
||||||
quit_allowed = True
|
quit_allowed = True
|
||||||
stop_allowed = False
|
stop_allowed = False
|
||||||
show_tracebacks = True
|
show_tracebacks = True
|
||||||
|
|
|
@ -885,22 +885,26 @@ class AdjustStockMenu(Menu):
|
||||||
self.print_header()
|
self.print_header()
|
||||||
product = self.input_product('Product> ')
|
product = self.input_product('Product> ')
|
||||||
|
|
||||||
|
|
||||||
print 'The stock of this product is: %d ' % (product.stock)
|
print 'The stock of this product is: %d ' % (product.stock)
|
||||||
#print 'Write the number of products you have added to the stock'
|
print 'Write the number of products you have added to the stock'
|
||||||
|
|
||||||
add_stock = self.input_int('Added stock> ', (-1000, 1000))
|
add_stock = self.input_int('Added stock> ', (-1000, 1000))
|
||||||
print 'You added %d to the stock of %s' % (add_stock,product)
|
print 'You added %d to the stock of %s' % (add_stock,product)
|
||||||
|
|
||||||
product.stock += add_stock
|
product.stock += add_stock
|
||||||
|
|
||||||
print 'The stock is now %d' % (product.stock)
|
print 'The stock is now %d' % (product.stock)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
print 'Stock is now stored'
|
print 'Stock is now stored'
|
||||||
|
self.pause()
|
||||||
except sqlalchemy.exc.SQLAlchemyError, e:
|
except sqlalchemy.exc.SQLAlchemyError, e:
|
||||||
print 'Could not store stock: %s' % (e)
|
print 'Could not store stock: %s' % (e)
|
||||||
self.pause()
|
self.pause()
|
||||||
return
|
return
|
||||||
|
print 'The stock is now %d' % (product.stock)
|
||||||
|
|
||||||
|
|
||||||
class AdjustCreditMenu(Menu): # reimplements ChargeMenu; these should be combined to one
|
class AdjustCreditMenu(Menu): # reimplements ChargeMenu; these should be combined to one
|
||||||
|
|
Loading…
Reference in New Issue