Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] stock_lot_is_archived #1275

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[IMP] stock_lot_is_archived: Add tests for editable field
rousseldenis committed Apr 19, 2023
commit c35f37cf50f3a1f1291a6bfc38657a3bab041bfc
13 changes: 13 additions & 0 deletions stock_lot_is_archived/tests/test_lot_archive.py
Original file line number Diff line number Diff line change
@@ -39,3 +39,16 @@ def test_lot_archive(self):
self.archive_wizard_obj._archive_lots()
self.assertTrue(self.lot.is_archived)
self.assertFalse(self.newer_lot.is_archived)

def test_lot_archive_editable(self):
"""
With a user which is not stock manager check the editable is False
Then add the the stock manager group, editable should be True
"""
user_demo = self.env.ref("base.user_demo")
lot_demo = self.lot.with_user(user_demo)
user_demo.groups_id -= self.env.ref("stock.group_stock_manager")
self.assertFalse(lot_demo.is_archived_editable)
user_demo.groups_id += self.env.ref("stock.group_stock_manager")
lot_demo = self.lot.with_user(user_demo)
self.assertTrue(lot_demo.is_archived_editable)