[REF] Cleanup of delete tag.
bzr revid: jth@openerp.com-20100402080855-8pvhqcspi9mhojpa
This commit is contained in:
parent
2f70003d7e
commit
336f0e40a4
|
@ -148,8 +148,10 @@
|
|||
<rng:define name="delete">
|
||||
<rng:element name="delete">
|
||||
<rng:attribute name="model" />
|
||||
<rng:optional><rng:attribute name="id" /> </rng:optional>
|
||||
<rng:optional><rng:attribute name="search" /></rng:optional>
|
||||
<rng:choice>
|
||||
<rng:attribute name="id" />
|
||||
<rng:attribute name="search" />
|
||||
</rng:choice>
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
|
||||
|
|
|
@ -535,14 +535,10 @@ class YamlInterpreter(object):
|
|||
# TODO add remove ir.model.data
|
||||
|
||||
def process_delete(self, node):
|
||||
ids = []
|
||||
if len(node.search):
|
||||
ids = self.pool.get(node.model).search(self.cr, self.uid, eval(node.search, self.eval_context))
|
||||
if len(node.id):
|
||||
try:
|
||||
ids.append(self.get_id(node.id))
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
ids = [self.get_id(node.id)]
|
||||
if len(ids):
|
||||
self.pool.get(node.model).unlink(self.cr, self.uid, ids)
|
||||
self.pool.get('ir.model.data')._unlink(self.cr, self.uid, node.model, ids, direct=True)
|
||||
|
|
Loading…
Reference in New Issue