[forms/inline] fix #703911: add new link disappears if inline box removed. Since we've the information, we must specify the target type else we get random cardinality on ambiguous relations
--- a/web/views/autoform.py Thu Feb 18 10:55:41 2010 +0100
+++ b/web/views/autoform.py Thu Feb 18 10:57:50 2010 +0100
@@ -175,7 +175,9 @@
@property
def removejs(self):
entity = self._entity()
- card = entity.e_schema.rdef(self.rtype, neg_role(self.role)).role_cardinality(self.role)
+ ttype = self._cw.entity_from_eid(self.peid).__regid__
+ rdef = entity.e_schema.rdef(self.rtype, neg_role(self.role), ttype)
+ card= rdef.role_cardinality(self.role)
# when one is adding an inline entity for a relation of a single card,
# the 'add a new xxx' link disappears. If the user then cancel the addition,
# we have to make this link appears back. This is done by giving add new link