Merge pull request #33685 from AMR-Mannesmann/fix(document)-is_child_table_same-for-new-docs
fix(document): is_child_table_same for new docs
This commit is contained in:
commit
5b26db7265
1 changed files with 5 additions and 1 deletions
|
|
@ -842,9 +842,13 @@ class Document(BaseDocument):
|
|||
|
||||
def is_child_table_same(self, fieldname):
|
||||
"""Validate child table is same as original table before saving"""
|
||||
|
||||
if self.is_new():
|
||||
return False
|
||||
|
||||
same = True
|
||||
value = self.get(fieldname)
|
||||
original_value = self._doc_before_save.get(fieldname)
|
||||
same = True
|
||||
|
||||
if len(original_value) != len(value):
|
||||
same = False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue