Browse Source

publish muk_utils - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
22f4fb1fa4
  1. 3
      muk_utils/__manifest__.py
  2. 2
      muk_utils/models/base.py
  3. 10
      muk_utils/tools/file.py

3
muk_utils/__manifest__.py

@ -16,11 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###################################################################################
{
"name": "MuK Utils",
"summary": """Utility Features""",
"version": '12.0.1.1.15',
"version": '12.0.1.1.16',
"category": 'Extra Tools',
"license": "AGPL-3",
"author": "MuK IT",

2
muk_utils/models/base.py

@ -78,8 +78,6 @@ class Base(models.AbstractModel):
index = {vals['id']: vals for vals in result}
return [index[record.id] for record in records if record.id in index]
@api.model
def _search_parents(self, domain=[], order=None):
self._check_parent_field()

10
muk_utils/tools/file.py

@ -45,6 +45,16 @@ def slugify(value):
value = str(re.sub('[-\s]+', '-', value))
return value
def check_name(name):
tmp_dir = tempfile.mkdtemp()
try:
open(os.path.join(tmp_dir, name), 'a').close()
except IOError:
return False
finally:
shutil.rmtree(tmp_dir)
return True
def compute_name(name, suffix, escape_suffix):
if escape_suffix:
name, extension = os.path.splitext(name)

Loading…
Cancel
Save