Merge lp://staging/~openerp-dev/openobject-addons/7.0-opw-596679-rgo into lp://staging/openobject-addons/7.0
Proposed by
Ravi Gohil (OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 10007 |
Proposed branch: | lp://staging/~openerp-dev/openobject-addons/7.0-opw-596679-rgo |
Merge into: | lp://staging/openobject-addons/7.0 |
Diff against target: |
31 lines (+5/-5) 1 file modified
procurement/procurement.py (+5/-5) |
To merge this branch: | bzr merge lp://staging/~openerp-dev/openobject-addons/7.0-opw-596679-rgo |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Trigaux (OpenERP) (community) | Approve | ||
Naresh(OpenERP) | Pending | ||
Review via email: mp+186294@code.staging.launchpad.net |
Description of the change
Hi,
This branch fixes the issue faced when user, who belongs to the company other than the 'Your Company', tries to create record for object stock.warehouse
The reason is the xml_id(warehouse0) used to set the default warehouse for stock.warehouse
I fixed this issue by searching the warehouse belonging to current user's company and set accordingly.
Kindly review the fix.
Thanks.
To post a comment you must log in.
Hi,
I've tested your branch. rdeheele/ oerp/sandbox/ parts/server/ openerp/ netsvc. py", line 292, in dispatch_rpc getService( service_ name).dispatch( method, params) rdeheele/ oerp/sandbox/ parts/server/ openerp/ service/ web_services. py", line 626, in dispatch rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/osv. py", line 188, in execute_kw rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/osv. py", line 131, in wrapper rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/osv. py", line 197, in execute rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/osv. py", line 185, in execute_cr rdeheele/ oerp/sandbox/ parts/addons/ product/ product. py", line 752, in copy context) rdeheele/ oerp/sandbox/ parts/addons/ mail/mail_ thread. py", line 302, in copy rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/orm. py", line 5038, in copy rdeheele/ oerp/sandbox/ parts/addons/ mail/mail_ thread. py", line 242, in create rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/orm. py", line 4477, in create field]. set(cr, self, id_new, field, vals[field], user, rel_context) or [] rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/fields. py", line 559, in set rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/orm. py", line 4325, in create missing_ default_ values( cr, user, vals, context) rdeheele/ oerp/sandbox/ parts/server/ openerp/ osv/orm. py", line 2491, in _add_missing_ default_ values get(cr, uid, missing_defaults, context) rdeheele/ oerp/sandbox/ parts/addons/ procurement/ procurement. py", line 554, in default_get obj.search( cr, uid, [('company_id', '=', res['company_ id'])], context=context)
It leads to the next traceback :
2013-10-17 11:24:42,490 3719 ERROR rhonalia openerp.netsvc: company_id
Traceback (most recent call last):
File "/home/
result = ExportService.
File "/home/
res = fn(db, uid, *params)
File "/home/
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
context=
File "/home/
return super(mail_thread, self).copy(cr, uid, id, default=default, context=context)
File "/home/
new_id = self.create(cr, uid, data, context)
File "/home/
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
File "/home/
result += self._columns[
File "/home/
id_new = obj.create(cr, user, act[2], context=context)
File "/home/
vals = self._add_
File "/home/
defaults = self.default_
File "/home/
warehouse_ids = warehouse_
KeyError: 'company_id'