Update scenario to version 4.0
This commit is contained in:
parent
7b49bd9f55
commit
58481945b0
|
@ -8,6 +8,8 @@ Imports::
|
|||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
>>> yesterday = today - relativedelta(days=1)
|
||||
|
||||
|
@ -16,44 +18,18 @@ Create database::
|
|||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install production Module::
|
||||
Install production_output_lot Module::
|
||||
|
||||
>>> Module = Model.get('ir.module.module')
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', 'in', ['production_output_lot', 'stock_lot_sequence'])])
|
||||
>>> Module.install([x.id for x in modules], config.context)
|
||||
>>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> Currency = Model.get('currency.currency')
|
||||
>>> CurrencyRate = Model.get('currency.currency.rate')
|
||||
>>> Company = Model.get('company.company')
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> company_config = Wizard('company.company.config')
|
||||
>>> company_config.execute('company')
|
||||
>>> company = company_config.form
|
||||
>>> party = Party(name='Dunder Mifflin')
|
||||
>>> party.save()
|
||||
>>> company.party = party
|
||||
>>> currencies = Currency.find([('code', '=', 'USD')])
|
||||
>>> if not currencies:
|
||||
... currency = Currency(name='Euro', symbol=u'$', code='USD',
|
||||
... rounding=Decimal('0.01'), mon_grouping='[3, 3, 0]',
|
||||
... mon_decimal_point=',')
|
||||
... currency.save()
|
||||
... CurrencyRate(date=today + relativedelta(month=1, day=1),
|
||||
... rate=Decimal('1.0'), currency=currency).save()
|
||||
... else:
|
||||
... currency, = currencies
|
||||
>>> company.currency = currency
|
||||
>>> company_config.execute('add')
|
||||
>>> company, = Company.find()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Create product::
|
||||
|
||||
|
@ -179,7 +155,7 @@ Make a production::
|
|||
u'1'
|
||||
>>> output_sequence.reload()
|
||||
>>> output_sequence.number_next
|
||||
2
|
||||
2L
|
||||
|
||||
|
||||
Make a production which uses the lot from product::
|
||||
|
@ -205,7 +181,7 @@ Make a production which uses the lot from product::
|
|||
u'1'
|
||||
>>> output_sequence.reload()
|
||||
>>> output_sequence.number_next
|
||||
2
|
||||
2L
|
||||
>>> product_sequence.reload()
|
||||
>>> product_sequence.number_next
|
||||
2
|
||||
2L
|
||||
|
|
Loading…
Reference in New Issue