Skip to content

Commit

Permalink
Merge PR OCA#3168 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by thomaspaulb
  • Loading branch information
OCA-git-bot committed Jan 17, 2025
2 parents c5af4ed + 5cd3d28 commit 70038de
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions base_multi_image/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ def _onchange_load_from(self):
# Retrieve from remote url
self.image_1920 = self._get_image_from_url(self.load_from)
filename = self.load_from.split("/")[-1]
self.name, self.extension = os.path.splitext(filename)
self.name = os.path.splitext(filename)[0]
else:
self.image_1920 = self._get_image_from_file(self.load_from)
self.name, self.extension = os.path.splitext(
os.path.basename(self.load_from)
)
self.name = os.path.splitext(os.path.basename(self.load_from))[0]
self.name = self._make_name_pretty(self.name)
self.load_from = False

Expand Down Expand Up @@ -185,5 +183,5 @@ def _make_name_pretty(self, name):
@api.onchange("filename")
def _onchange_filename(self):
if self.filename:
self.name, self.extension = os.path.splitext(self.filename)
self.name = os.path.splitext(self.filename)[0]
self.name = self._make_name_pretty(self.name)

0 comments on commit 70038de

Please sign in to comment.