Comment 5 for bug 783994

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote : Re: [6.0] account_move_line: uninitialized period_id

Hello again,

I can reproduce it now.

- openerp 6.0 series with demo data and gtk client
- Accounting > Configuration > Journals > Purchase Journal
- Enable "check date not in period" (this is important to reproduce the bug)
- Account > Journal Items > New
- in the new line:
  * select any account
  * name = /
  * journal = Purchase Journal
- click Save and you get the stack trace below

Best regards,

-sbi

Environment Information :
System : Windows-XP-5.1.2600-SP3
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : fr_BE.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.2
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "D:\Project\OpenErp6\server\bin\netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "D:\Project\OpenErp6\server\bin\service\web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "D:\Project\OpenErp6\server\bin\osv\osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "D:\Project\OpenErp6\server\bin\osv\osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "D:\Project\OpenErp6\server\bin\osv\osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "D:\Project\OpenErp6\addons\account\account_move_line.py", line 1221, in create
    self._check_date(cr, uid, vals, context, check)
  File "D:\Project\OpenErp6\addons\account\account_move_line.py", line 1123, in _check_date
    if journal.allow_date and period_id:
UnboundLocalError: local variable 'period_id' referenced before assignment