Change unlink to delete for issue201
This commit is contained in:
+2
-2
@@ -114,7 +114,7 @@
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record>
|
||||
<record model="ir.model.access" id="access_location_admin">
|
||||
<field name="model" search="[('model', '=', 'stock.location')]"/>
|
||||
@@ -122,7 +122,7 @@
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="True"/>
|
||||
<field name="perm_delete" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- Default locations -->
|
||||
|
||||
@@ -301,11 +301,11 @@ class Move(OSV):
|
||||
}, context=context)
|
||||
return super(Move, self).write(cursor, user, ids, vals, context=context)
|
||||
|
||||
def unlink(self, cursor, user, ids, context=None):
|
||||
def delete(self, cursor, user, ids, context=None):
|
||||
for move in self.browse(cursor, user, ids, context=context):
|
||||
if move.state not in ('draft', 'cancel'):
|
||||
self.raise_user_error(cursor, 'del_draft_cancel',
|
||||
context=context)
|
||||
return super(Move, self).unlink(cursor, user, ids, context=context)
|
||||
return super(Move, self).delete(cursor, user, ids, context=context)
|
||||
|
||||
Move()
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ class PackingIn(OSV):
|
||||
packing = self.browse(cursor, user, packing_id, context=context)
|
||||
move_obj.set_state_draft(cursor, user,
|
||||
[m.id for m in packing.incoming_moves], context=context)
|
||||
move_obj.unlink(cursor, user,
|
||||
move_obj.delete(cursor, user,
|
||||
[m.id for m in packing.inventory_moves], context=context)
|
||||
self.write(cursor, user, packing_id, {
|
||||
'state': 'draft',
|
||||
|
||||
Reference in New Issue
Block a user