Browse Source

Tenames and typos.

pull/402/head
Jairo Llopis 9 years ago
parent
commit
f286dde8ca
  1. 10
      base_multi_image/models/image.py
  2. 2
      base_multi_image/models/owner.py

10
base_multi_image/models/image.py

@ -14,7 +14,7 @@ from openerp import tools
_logger = logging.getLogger(__name__)
class ImageABC(models.Model):
class Image(models.Model):
_name = "base_multi_image.image"
_sql_constraints = [
('uniq_name_owner', 'UNIQUE(owner_id, owner_model, name)',
@ -139,7 +139,7 @@ class ImageABC(models.Model):
_('The image filestore cannot be created, %s') % e)
@api.model
def _make_pretty(self, name):
def _make_name_pretty(self, name):
return name.replace('_', ' ').capitalize()
@api.onchange('url')
@ -147,20 +147,20 @@ class ImageABC(models.Model):
if self.url:
filename = self.url.split('/')[-1]
self.name, self.extension = os.path.splitext(filename)
self.name = self._make_pretty(self.name)
self.name = self._make_name_pretty(self.name)
@api.onchange('path')
def _onchange_path(self):
if self.path:
self.name, self.extension = os.path.splitext(os.path.basename(
self.path))
self.name = self._make_pretty(self.name)
self.name = self._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 = self._make_pretty(self.name)
self.name = self._make_name_pretty(self.name)
@api.constrains('storage', 'url')
def _check_url(self):

2
base_multi_image/models/owner.py

@ -35,7 +35,7 @@ class Owner(models.AbstractModel):
@api.multi
@api.depends('image_ids')
def _get_multi_image(self):
"""Get a the main image for this object.
"""Get the main image for this object.
This is provided as a compatibility layer for submodels that already
had one image per record.

Loading…
Cancel
Save