[FIX] call method on attachement_id instead of self

This commit is contained in:
vrenaville
2017-02-15 18:57:20 +01:00
parent a8501bf67c
commit b57ee6bf95
@@ -17,7 +17,7 @@ class ShippingLabel(models.Model):
@api.depends('store_fname', 'db_datas') @api.depends('store_fname', 'db_datas')
def _compute_datas(self): def _compute_datas(self):
values = self._data_get('datas', None) values = self.attachment_id._data_get('datas', None)
for attach in self: for attach in self:
attach.datas = values.get(attach.id) attach.datas = values.get(attach.id)
@@ -43,6 +43,6 @@ class ShippingLabel(models.Model):
# have write access # have write access
super(ShippingLabel, attach.sudo()).write(vals) super(ShippingLabel, attach.sudo()).write(vals)
if fname: if fname:
self._file_delete(fname) self.attachment_id._file_delete(fname)
continue continue
self.attachment_id._data_set('datas', attach.datas, None) self.attachment_id._data_set('datas', attach.datas, None)