Browse Source

publish muk_attachment_lobject - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
4a8807a962
  1. 2
      muk_attachment_lobject/__manifest__.py
  2. 12
      muk_attachment_lobject/models/ir_attachment.py

2
muk_attachment_lobject/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Large Objects Attachment",
"summary": """Large Objects Attachment Location""",
"version": '12.0.2.0.3',
"version": '12.0.2.0.5',
"category": 'Extra Tools',
"license": "AGPL-3",
"website": "http://www.mukit.at",

12
muk_attachment_lobject/models/ir_attachment.py

@ -35,13 +35,21 @@ class LObjectIrAttachment(models.Model):
store_lobject = LargeObject(
string="Data")
@api.model
def storage_locations(self):
locations = super(LObjectIrAttachment, self).storage_locations()
locations.append('lobject')
return locations
@api.model
def force_storage(self):
if not self.env.user._is_admin():
raise AccessError(_('Only administrators can execute this action.'))
if self._storage() != 'lobject':
return super(LObjectIrAttachment, self).force_storage()
else:
storage_domain = {
'db': ('store_lobject', '=', False),
'file': ('store_fname', '=', False),
'lobject': ('store_lobject', '=', False),
}
record_domain = [
'&', storage_domain[self._storage()],

Loading…
Cancel
Save