dabo Commit
Revision 6046
Date: 2010-10-02 07:38:25 -0700 (Sat, 02 Oct 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6046

Changed:
U   trunk/dabo/biz/dBizobj.py

Log:
Fixed an issue #1373 in which child bizobjs that did not link to the parent's 
PK column threw exceptions. Issue reported and patch created by Jacek 
Ka?\197?\130ucki.


Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2010-10-01 13:52:07 UTC (rev 6045)
+++ trunk/dabo/biz/dBizobj.py   2010-10-02 14:38:25 UTC (rev 6046)
@@ -1043,17 +1043,17 @@
                is the PK of the parent, but can be a non-PK field, if this 
bizobj's ParentLinkField is
                not empty.
                """
-               ret = None
-               if self.Parent:
-                       fld = self.ParentLinkField
-                       try:
-                               if not fld:
-                                       # Use the PK value
-                                       ret = self.getParentPK()
-                               else:
-                                       ret = self.Parent.getFieldVal(fld)
-                       except dException.NoRecordsException:
-                               ret = NO_RECORDS_PK
+               if not self.Parent:
+                       return None
+               fld = self.ParentLinkField
+               try:
+                       if not fld:
+                               # Use the PK value
+                               ret = self.getParentPK()
+                       else:
+                               ret = self.Parent.getFieldVal(fld)
+               except dException.NoRecordsException:
+                       ret = NO_RECORDS_PK
                return ret
 
 
@@ -1399,7 +1399,7 @@
                if self.AutoPopulatePK:
                        pk = self.getPK()
                        for child in self.__children:
-                               child.setParentFK(pk)
+                               child.setParentFK()
                # Call the custom hook method
                self.onSaveNew()
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to