Merge lp:~mmakonnen/openobject-addons/openobject-addons into lp:openobject-addons
Status: | Merged |
---|---|
Merged at revision: | 8181 |
Proposed branch: | lp:~mmakonnen/openobject-addons/openobject-addons |
Merge into: | lp:openobject-addons |
Diff against target: |
15 lines (+2/-2) 1 file modified
account/account.py (+2/-2) |
To merge this branch: | bzr merge lp:~mmakonnen/openobject-addons/openobject-addons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+135702@code.launchpad.net |
Description of the change
This change fixes a bug I encountered when trying to create a physical inventory from the last nightly build. I configured the warehouse module to keep accounting valuations of my stock and then tried to create an initial inventory. When I reached the validation step I got the following error:
File "/home/
c['period_id'] = vals['period_id']
KeyError: 'period_id'
Basically, the problem is that the stock module doesn't specify a financial period or date for the account move line, which then promptly falls flat on its face. If either of these values are not provided it should provide its own values: period_id should default to the current period, date already has a _defaults line which uses the current date so if one isn't specified don't try to set it.
Tried your patch/diff. Same result.
File "/opt/openerp/ server/ openerp/ addons/ account/ account. py", line 1442, in create period( cr, uid, context)
c['period_id'] = vals['period_id'] if 'period_id' in vals else self._get_
KeyError: 'period_id'
I don't know Python, but is it possible that c['period_id'] does not exists ?
Maybe something (a row) has to be created after setting the realtime option ?