account_move_line: uninitialized period_id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP R&D Addons Team 3 |
Bug Description
Hi,
We obtained the following stack trace while creating a journal entry. Although I'm not sure of the root cause, there is indeed a code path where period_id may be uninitialized. I attach a proposed patch.
Best regards,
-sbi
Environment Information :
System : Windows-32bit-SP2
OS Name : nt
Operating System Release :
Operating System Version : 32bit
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 "/usr/local/
result = ExportService.
File "/usr/local/
res = fn(db, uid, *params)
File "/usr/local/
return f(self, dbname, *args, **kwargs)
File "/usr/local/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/local/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/local/
self.
File "/usr/local/
if journal.allow_date and period_id:
UnboundLocalError: local variable 'period_id' referenced before assignment
Related branches
- Mustufa Rangwala (Open ERP) (community): Approve
- Ashvin Rathod (OpenERP) (community): Needs Resubmitting
- qdp (OpenERP): Needs Fixing
-
Diff: 82 lines (+8/-32)1 file modifiedaccount/account_move_line.py (+8/-32)
- Priyesh (OpenERP) (community): Approve
- Amit Dodiya (OpenERP) (community): Needs Resubmitting
-
Diff: 75 lines (+8/-31)1 file modifiedaccount/account_move_line.py (+8/-31)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
milestone: | none → 6.1 |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | In Progress → Fix Committed |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |
tags: | added: maintenance |
Hello Stephane,
I have checked your issue at my end.
But all are working fine and I am not able to faced any traceback.
See the _check_date function and print the vals it gives o/p like this
{'analytic_lines': [], 'statement_id': False, 'currency_id': False, 'date_maturity': False, 'narration': False, 'partner_id': 7, 'blocked': 0, 'analytic_ account_ id': False, 'journal_id': 1, 'tax_code_id': False, 'debit': False, 'ref': False, 'account_id': 9, 'period_id': 2, 'date_created': '2011-05-19', 'date': '2011-01-24', 'move_id': 8, 'tax_amount': False, 'name': 'eeee', 'account_tax_id': False, 'credit': False, 'amount_currency': False, 'quantity': False}
Which have the period_id because the "period_id" is required field in account.move.line so no need to assign it again as a False.
That's why in any case I am not faced any traceback so would you please provide your side example or proper steps in which you have faced the traceback.
Thanks and Waiting for your reply!