fields.function with type=M2O and store=True fails to be read on read().
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
High
|
Anup(SerpentCS) |
Bug Description
branch-server 2066
branch-addons official 2735
branch-addons chricar_
stable_
branch/
What I did
Stock/Location Structure/open one internal location (leave all fields empty)/ All stock moves / Print screen
but I think this is introduced by 5.0.11, because it worked until recently
the object and view stock moves is modified
def _partner_id(self, cr, uid, ids, field_name, arg, context={}):
result = {}
for partner in self.browse(cr, uid, ids, context):
if not partner.partner_id and (partner.
if partner.
if partner.
if pname:
return result
.....
I had to set int(pname) - to make it work in views - but may be this causes printscreen etc to crash
it looks like a data dependent error - because selecting some lines can be printed, some not
Environment Information :
System : Linux-2.
OS Name : posix
LSB Version: core-2.
Distributor ID: SUSE LINUX
Description: openSUSE 11.2 (x86_64)
Release: 11.2
Codename: n/a
Operating System Release : 2.6.31.
Operating System Version : #1 SMP PREEMPT 2010-03-16 21:25:39 +0100
Operating System Architecture : 64bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.2
OpenERP-Client Version : 5.0.6
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/home/
(result, format) = obj.create(cr, uid, ids, datas, context)
File "/home/
res = self._create_
File "/home/
line[f]= line[f][1]
TypeError: 'int' object is unsubscriptable
thanks for looking into this
Related branches
summary: |
- 5.0.11 - Print Screen - Export - Exception: 'int' object is - unsubscriptable + fields.function with type=M2O and store=True fails to be read on read(). |
Changed in openobject-server: | |
importance: | Undecided → High |
just want to correct myself
after comparing a printable with not printable line I believe it's not data dependant.
the lines with fixed text from the following statement are printable the others not.
def _partner_name(self, cr, uid, ids, field_name, arg, context={}):
# pname=' ' sale_line_ id or partner. purchase_ line_id) :
pname = partner. partner_ id.name sale_line_ id:
pname = partner. sale_line_ id.order_ id.partner_ id.name purchase_ line_id:
pname = partner. purchase_ line_id. order_id. partner_ id.name location_ id.usage == 'internal': location_ dest_id. usage == 'production':
pname = ' Used for Production' location_ dest_id. usage == 'inventory':
pname = ' Inventory' location_ dest_id. usage == 'internal':
pname = ' Internal' location_ id.usage == 'production' and partner. location_ dest_id. usage == 'internal' ):
pname = ' Production'
result = {}
for partner in self.browse(cr, uid, ids, context):
pname = None
if partner.partner_id and not (partner.
if partner.
if partner.
if not pname and partner.
if partner.
if partner.
if partner.
if not pname and (partner.
return result
....
'partner_ name' : fields. function( _partner_ name, method=True, string= "Partner" ,type=' char', size=132,store=True ),