FIX module tests

This commit is contained in:
Raimon Esteve 2018-08-30 15:33:08 +02:00
parent 851e672371
commit 03596a5115
2 changed files with 16 additions and 15 deletions

View File

@ -22,7 +22,7 @@ class Statement:
__metaclass__ = PoolMeta
__name__ = 'account.statement'
users = fields.Function(fields.One2Many('res.user', None, 'Users'),
'get_users', setter='set_users', searcher='search_users')
'get_users', searcher='search_users')
@classmethod
def get_users(cls, statements, names):

View File

@ -52,6 +52,7 @@ Create parties::
>>> Party = Model.get('party.party')
>>> customer = Party(name='Customer')
>>> customer.account_receivable = receivable
>>> customer.save()
Create category::
@ -103,8 +104,8 @@ Create a shop::
>>> shop = Shop()
>>> shop.name = 'Local shop'
>>> shop.warehouse = warehouse
>>> shop.shipment_method = 'order'
>>> shop.invoice_method = 'order'
>>> shop.sale_shipment_method = 'order'
>>> shop.sale_invoice_method = 'order'
>>> sequence, = Sequence.find([('code', '=', 'sale.sale')])
>>> shop.sale_sequence = sequence
>>> shop.payment_term = payment_term
@ -203,8 +204,8 @@ Open statements for current device::
0
>>> open_statment = Wizard('open.statement')
>>> open_statment.execute('create_')
>>> open_statment.form.result
u'Statement Default opened. \n'
>>> open_statment.form.result == 'Statement Default opened. \n'
True
>>> payment_statement, = Statement.find([('state', '=', 'draft')])
Partially pay the sale::
@ -256,8 +257,8 @@ An invoice should be created for the sale::
>>> invoice, = sale.invoices
>>> config.user = account_user.id
>>> invoice.state
u'posted'
>>> invoice.state == 'posted'
True
>>> invoice.untaxed_amount
Decimal('20.00')
>>> invoice.tax_amount
@ -269,19 +270,19 @@ When the statement is closed the invoices are paid and sale is done::
>>> close_statment = Wizard('close.statement')
>>> close_statment.execute('validate')
>>> close_statment.form.result
u'Statement Default - Default closed. \n'
>>> close_statment.form.result == 'Statement Default - Default closed. \n'
True
>>> payment_statement.reload()
>>> payment_statement.state
u'validated'
>>> payment_statement.state == 'validated'
True
>>> all(l.invoice == invoice for l in payment_statement.lines)
True
>>> payment_statement.balance
Decimal('22.00')
>>> invoice.reload()
>>> invoice.state
u'paid'
>>> invoice.state == 'paid'
True
>>> config.user = sale_user.id
>>> sale.reload()
>>> sale.state
u'done'
>>> sale.state == 'done'
True