19 lines
341 B
Python
19 lines
341 B
Python
from proteus import Model, config
|
|
from random import randint
|
|
|
|
database = 'tryton'
|
|
config_file = '/app/.dev/trytond.cfg'
|
|
|
|
config.set_trytond(database, config_file=config_file)
|
|
|
|
Stock = Model.get('stock.inventory')
|
|
stock, = Stock.find([('state', '=', 'draft')])
|
|
|
|
|
|
for line in stock.lines:
|
|
line.quantity = randint(0, 50)
|
|
line.save()
|
|
|
|
|
|
|