Fix for new modeldb
This commit is contained in:
1 parent
e13a3a3e80
commit
703cbbe874
1 file changed
+15
-4
+15
-4
@@ -71,11 +71,20 @@ class PurchaseLine(OSV):
|
||||
user, analytic_accounts_field, fields_names, context=context))
|
||||
return res
|
||||
|
||||
def _read_flat(self, cursor, user, ids, fields_names, context=None,
|
||||
load='_classic_read'):
|
||||
def read(self, cursor, user, ids, fields_names=None, context=None):
|
||||
selection_obj = self.pool.get('analytic_account.account.selection')
|
||||
res = super(PurchaseLine, self)._read_flat(cursor, user, ids,
|
||||
fields_names, context=context, load=load)
|
||||
|
||||
int_id = False
|
||||
if isinstance(ids, (int, long)):
|
||||
int_id = True
|
||||
ids = [ids]
|
||||
|
||||
res = super(PurchaseLine, self).read(cursor, user, ids,
|
||||
fields_names=fields_names, context=context)
|
||||
|
||||
if not fields_names:
|
||||
fields_names = list(set(self._columns.keys() \
|
||||
+ self._inherit_fields.keys()))
|
||||
|
||||
root_ids = []
|
||||
for field in fields_names:
|
||||
@@ -93,6 +102,8 @@ class PurchaseLine(OSV):
|
||||
if account.root.id in root_ids:
|
||||
id2record[line.id]['analytic_account_' \
|
||||
+ str(account.root.id)] = account.id
|
||||
if int_id:
|
||||
return res[0]
|
||||
return res
|
||||
|
||||
def create(self, cursor, user, vals, context=None):
|
||||
|
||||
Reference in new issue
Block a user