Skip to content

Commit

Permalink
[fix] flake 8
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Sep 28, 2016
1 parent 4f88d88 commit 70c7191
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions stock_operating_unit/model/stock.py
Expand Up @@ -82,9 +82,13 @@ def _check_company_operating_unit(self):
@api.constrains('operating_unit_id', 'location_id')
def _check_parent_operating_unit(self):
for rec in self:
if (rec.location_id and rec.location_id.usage == 'internal'
and rec.operating_unit_id and rec.operating_unit_id !=
rec.location_id.operating_unit_id):
if (
rec.location_id
and rec.location_id.usage == 'internal'
and rec.operating_unit_id
and rec.operating_unit_id !=
rec.location_id.operating_unit_id
):
raise UserError(_('Configuration error!\nThe Parent\
Stock Location must belong to the same Operating Unit.'))

Expand Down
4 changes: 2 additions & 2 deletions stock_operating_unit/tests/test_stock_security.py
Expand Up @@ -57,8 +57,8 @@ def test_stock_ou_security(self):
move_ids =\
self.MoveObj.sudo(self.user2_id).\
search([('picking_id', '=', self.picking_in1.id)]).ids
self.assertEqual(move_ids, [], 'User 2 should not be able to list'
'the stock moves assigned to picking 1.')
self.assertEqual(move_ids, [], 'User 2 should not be able to list the '
'stock moves assigned to picking 1.')
# User 2 cannot list the pickings 1
picking_ids =\
self.PickingObj.sudo(self.user2_id).\
Expand Down

0 comments on commit 70c7191

Please sign in to comment.