Change CI to GitHub actions

Use copier template from oca/oca-addons-repo-template

Target Python3.8

Apply linting

Fix a missing call to super
This commit is contained in:
Yannick Payot
2023-05-24 16:09:11 +02:00
parent dc83bd74b3
commit 9ca3f6a710
83 changed files with 1714 additions and 912 deletions
@@ -3,7 +3,7 @@
import logging
from odoo import models, api
from odoo import api, models
_logger = logging.getLogger(__name__)
@@ -14,23 +14,23 @@ class IrAttachment(models.Model):
_inherit = "ir.attachment"
def _get_stores(self):
l = ['s3']
l += super(IrAttachment, self)._get_stores()
return l
stores = ["s3"]
stores += super()._get_stores()
return stores
@api.model
def _store_file_read(self, fname, bin_size=False):
if fname.startswith('s3://'):
if fname.startswith("s3://"):
return FAKE_S3_BUCKET.get(fname)
else:
return super(IrAttachment, self)._store_file_read(fname, bin_size)
@api.model
def _store_file_write(self, key, bin_data):
location = self.env.context.get('storage_location') or self._storage()
if location == 's3':
location = self.env.context.get("storage_location") or self._storage()
if location == "s3":
FAKE_S3_BUCKET[key] = bin_data
filename = 's3://fake_bucket/%s' % key
filename = "s3://fake_bucket/%s" % key
else:
_super = super(IrAttachment, self)
filename = _super._store_file_write(key, bin_data)
@@ -38,7 +38,7 @@ class IrAttachment(models.Model):
@api.model
def _store_file_delete(self, fname):
if fname.startswith('s3://'):
if fname.startswith("s3://"):
FAKE_S3_BUCKET.pop(fname)
else:
super(IrAttachment, self)._store_file_delete(fname)