mirror of
https://github.com/NaN-tic/trytond-galatea_tutorial.git
synced 2023-12-14 02:32:55 +01:00
New API for on_change
This commit is contained in:
parent
798ccb6a9c
commit
aefcebc8ef
1 changed files with 2 additions and 3 deletions
|
@ -108,11 +108,10 @@ class GalateaTutorial(ModelSQL, ModelView):
|
|||
'image_size': ('Thumb "%(file_name)s" size is larger than "%(size)s"Kb'),
|
||||
})
|
||||
|
||||
@fields.depends('name', 'slug')
|
||||
def on_change_name(self):
|
||||
res = {}
|
||||
if self.name and not self.slug:
|
||||
res['slug'] = slugify(self.name)
|
||||
return res
|
||||
self.slug = slugify(self.name)
|
||||
|
||||
@classmethod
|
||||
def write(cls, *args):
|
||||
|
|
Loading…
Reference in a new issue