# HG changeset patch # User Sylvain Thénault # Date 1266487070 -3600 # Node ID c26b4df9fc90d601d9257d3e9eb4ab4beb86bb12 # Parent d8c3a50a8ee7c24764abee8c854c268ed27d03f0 [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 diff -r d8c3a50a8ee7 -r c26b4df9fc90 web/views/autoform.py --- 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