line: felder löschen bei änderung von bookingtype
This commit is contained in:
parent
7999440de7
commit
3db6822f26
3 changed files with 23 additions and 5 deletions
10
line.py
10
line.py
|
@ -527,12 +527,18 @@ class Line(Workflow, ModelSQL, ModelView):
|
|||
if not self.bookingtype in types.get(self.category.cattype, ''):
|
||||
self.category = None
|
||||
|
||||
if self.bookingtype in ['spin', 'spout']:
|
||||
if self.bookingtype.startswith('sp'): # split booking
|
||||
self.category = None
|
||||
self.booktransf = None
|
||||
for spline in self.splitlines:
|
||||
if not self.bookingtype in types.get(getattr(spline.category, 'cattype', '-'), ''):
|
||||
spline.category = None
|
||||
else :
|
||||
elif self.bookingtype.startswith('mv'): # transfer
|
||||
self.splitlines = []
|
||||
self.category = None
|
||||
else : # category
|
||||
self.splitlines = []
|
||||
self.booktransf = None
|
||||
|
||||
@fields.depends('description')
|
||||
def on_change_with_descr_short(self, name=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue